Write The Service of Transport Layer
Write The Service of Transport Layer
ANS
Some transport protocols (like TCP) provide error checking, acknowledgments, and
retransmissions to ensure data is correctly received.
3.Flow Control:
Prevents the sender from overwhelming the receiver by regulating data transmission speed.
4.Congestion Control:
Helps prevent network congestion by adjusting the sender’s transmission rate based on
network conditions.
UDP (User Datagram Protocol): Connectionless, unreliable, and lightweight, useful for
real-time applications like VoIP and video streaming.
Multiplexing allows multiple applications on a single device to share the transport layer. The
transport layer collects data from different application-layer processes, encapsulates them
with transport-layer headers, and forwards them to the network layer.
Each transport-layer segment includes source and destination port numbers, which help
identify the sending and receiving application processes.
Demultiplexing (At the Receiver)
Demultiplexing ensures that incoming transport-layer segments are correctly delivered to the
appropriate application process. The transport layer examines the port numbers in the
segment header and directs the segment to the correct socket.
Source IP Address
Destination IP Address
TCP assigns a unique socket for each connection, ensuring that multiple applications can
run simultaneously without interference. Example (Web Browsing - TCP) A user opens
multiple tabs in a browser to visit www.example.com and www.google.com
TCP creates separate connections for each tab using different port numbers.
The web server distinguishes requests based on the source port number and destination
IP address, ensuring that responses go to the correct tab.
The advantages are ensures reliable, ordered, and complete data delivery.
2.Suitable for applications like web browsing (HTTP/HTTPS), email (SMTP, IMAP), and file
transfer (FTP). The disadvantages are slower due to connection setup and error
handling.
Each UDP packet (datagram) is independent and does not track previous or future
packets.
Identified by a 2-tuple:
Destination IP Address
The DNS server receives the request, processes it, and sends back a response to the
correct application using the destination port number.
The advantages are faster connection and uses fewer system resources, making it
efficient for real-time applications like video streaming, gaming, and VoIP.
The disadvantages are no reliability—packets may be lost or arrive out of order and
no congestion or flow control, which can lead to data loss if the network is overloaded.
To achieve reliable data transfer, the following principles and mechanisms are typically involved:
1. Acknowledgments (ACKs)
When the receiver receives a data packet correctly, it sends an acknowledgment (ACK) back to
the sender, confirming the successful receipt of the data.
Positive Acknowledgment: The receiver sends an ACK to indicate the successful receipt of the
packet.
The sender sets a timeout period after sending a packet. If the sender doesn’t receive an
acknowledgment (or NAK) before the timeout expires, it will retransmit the data packet.
Retransmission ensures that packets that were lost or corrupted during transmission are
sent again, increasing the reliability of the communication.
The timeout period is crucial; it should be long enough to account for network delays
but short enough to retransmit lost packets promptly.
Sequence Numbers
To avoid confusion between multiple copies of the same packet (in case of
retransmissions), sequence numbers are added to each packet.
Sequence numbers help the receiver know the order in which packets are supposed to
be delivered and detect duplicates.
The receiver uses the sequence number to identify if it has already received a particular
packet and to reassemble the data in the correct order.
Checksums or cyclic redundancy checks (CRC) are commonly used to detect errors in
transmitted data.
If a packet is received with errors (e.g., corrupted data), it is discarded, and the sender is
notified through the ACK/NAK mechanism.
Some protocols may include error correction mechanisms, where the receiver can
correct errors in the data itself, although this is less common than error detection.
4. Describe about the UDP header format and its segment structure.
The UDP datagram consists of a header and the data being transmitted. The header includes the
following four fields (each 2 bytes long):
Length (2 bytes): The total length of the UDP header and the data.
Checksum (2 bytes): A checksum used for error checking of the header and data. This field is
optional in IPv4, but it is mandatory in IPv6.
5. List Internet applications and transport protocol in transport layer.
1. Data Division: The sender divides the data into fixed-size blocks (e.g., 16-bit or 32-bit
words).
2. Checksum Calculation: The sender adds up all blocks using binary addition and takes the
complement of the sum (usually 1’s complement or modulo sum).
3. Transmission: The sender transmits the original data along with the checksum.
4. Verification: The receiver performs the same checksum calculation on the received data
and compares it with the received checksum. If the values match, the data is assumed to
be correct. Otherwise, an error is detected.