top

Search

Software Key Tutorial

.

UpGrad

Software Key Tutorial

Transport Layer Protocols

Introduction

Transport Layer Protocols are a key topic for computer networks and the internet. It plays a vital role in our day-to-day lives, often without us realizing it. Every time we send an email, download a song or visit a website, the transport layer protocols work in the background. They act like the post office of the digital world.

Here's how: Imagine you're posting a letter. You would only send it by packaging properly, right? And you'd want it to reach the right address safely. This is what Transport Layer Protocols do for your data. They divide the data into small pieces called packets, which are easier to send. They also make sure each packet gets to the right destination in the right order. Transport Layer Protocols can even check if all packets have arrived and resend any that got lost.

This guide will explore two main types of protocols: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). Understanding these can help you understand how our digital world communicates.

Overview

Transport layer protocols in computer networks act as the hidden heroes behind our seamless online interactions. They deal with dividing and tracking data packets to ensure successful data transmission.

You may wonder, "How are they different from network layer protocols?" Well, network layer protocols focus on how data moves through different networks. Transport layer protocols worry about the data, ensuring it gets from point A to B correctly.

Examples of transport layer protocols include the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP). Both have their own unique ways of handling data. These protocols are also crucial in the realm of the Internet of Things (IoT). They enable your smart devices to communicate effectively. A vital feature of these protocols is that they address the transport layer. This allows data packets to find their correct destination.

What is Transport Layer Protocol?

Transport Layer Protocols deal with the set of rules used in computer networks. Their job is to prepare data for delivery over the network.

When we transmit data online, it's like sending a big package. Dispatching it all at once could be hard. So, the protocol breaks it into smaller parts called "packets".  But there's more. These protocols also add information to each packet. This includes where it is coming from and where it's going. This is called "addressing in the transport layer". It makes sure the packet gets to the right place.

Transport layer protocols examples

What is the Transport Layer? 

The transport layer is a vital part of the computer networking system. Imagine it as a bridge that connects applications on a device to the internet. When you want to send data over the internet, it can't be sent as it is. It needs some prep work. The transport layer does this job. It takes the data from the application and gets it ready for travel. The transport layer breaks the data into smaller pieces called packets, with each one having the sender's and receiver's addresses.

This layer also checks if the data reached it correctly and if all packets arrived. 

Features Of Transmission Control Protocol

Features of TCP are:

  1. Connection-Oriented: TCP is like making a phone call. Before sending data, it first sets up a connection and is kept open until all data is sent and received. For example, when you load a webpage, TCP sets up a connection before the webpage data is sent to your computer.

  2. Ordered Data Transfer: If you're sending a series of messages, TCP ensures they arrive in order. It's like numbering your pages in a report. If page 5 arrives before page 3, TCP will rearrange them in the right order.

  3. Error Checking: TCP is careful and checks each packet for errors. If it finds any packet missing, it asks for that specific one to be sent again.

  4. Congestion Control: TCP keeps an eye on network traffic. If a lot of data is sent, it slows down the data rate.

  5. Flow Control: TCP ensures the receiver isn't overwhelmed with data. It checks how much data the receiver can handle at once and adjusts the data flow accordingly.

TCP Segment Format

A TCP segment is like a packet of information. It has a specific format or structure. Here's what it includes:

  1. Source Port and Destination Port (16 bits each): These are the addresses of the sender and receiver.

  2. Sequence Number (32 bits): This number helps put the received packets in the right order.

  3. Acknowledgment Number (32 bits): This number is a confirmation that the data has been received.

  4. Data Offset (4 bits): It tells where the data starts in the packet.

  5. Reserved (6 bits), Flags (6 bits): These are for special instructions like ending a connection.

  6. Window Size (16 bits): It tells how much data the receiver can accept.

  7. Checksum (16 bits): This is used for error-checking.

  8. Urgent Pointer (16 bits): It's used when some data needs to be sent urgently.

  9. Options (variable): These are additional settings, if any.

  10. Data (variable): This is the actual data being sent.

Each part plays a key role in making TCP reliable and efficient.

Services provided by Transport Layer

  1. Process-to-Process Communication: The transport layer enables two processes (applications or services) on different machines to talk to each other over a network. For example, when you send an email from your laptop, the email client (a process) on your device communicates with the email server (another process) over the Internet.

  2. Multiplexing and Demultiplexing: Multiplexing is like packing multiple letters into one big envelope. It allows data from multiple applications to be transmitted together over the network. Demultiplexing is the opposite - it's like sorting the letters received in the big envelope to the right recipients. It separates data coming in from the network into the correct applications on the receiving machine.

  3. Flow Control: This service prevents the sender from overwhelming the receiver with too much data at once. The receiver tells the sender how much data it can handle at a time.

  4. Data Integrity: The transport layer ensures data is received correctly. It checks for any mistakes in the data and requests a retransmission if an error is detected. This is similar to double-checking your shopping list with a friend to make sure you didn't forget anything.

  5. Congestion Avoidance: Congestion avoidance is like traffic management. If there's too much data being sent and the network is getting congested, the transport layer reduces the data rate to prevent data loss.

Working of Transport Layer 

Imagine you're sending a text message over the internet. This is how it gets dispatched.

Stage

Description

Application Layer

You type the message into your messaging app.

Transport Layer

Your message is broken into packets. Each packet is labeled with the sender's and receiver's information, like addresses on letters.

Network Layer

The packets are sent over the internet, each possibly taking a different route, like cars on a road trip.

Transport Layer (Receiver's end)

The packets reach the receiver's device. Here, the transport layer checks if all packets have arrived and puts them in the right order.

Application Layer (Receiver's end)

The complete message is passed to the receiver's messaging app and displayed on their screen.

This is how the transport layer works when you send a text message. It ensures your message is delivered correctly, whether you're messaging someone in the same room or across the world.

Transport Layer Protocols in IoT

Transport layer protocols play a key role in the Internet of Things (IoT), where devices need to communicate efficiently.

Two common protocols are TCP and UDP. The former is used when data delivery is crucial, like updating firmware on a device. It's reliable but needs more resources, which may not suit battery-powered IoT devices. Whereas the latter is lightweight and fast, making it great for real-time data like sensor readings. However, it doesn't confirm if the data arrives.

Recently, new protocols have been developed for IoT, like CoAP and MQTT. They're designed to work well with the limited resources of IoT devices.

What is UDP?

UDP, or User Datagram Protocol, is a transport layer protocol. It sends data packets without waiting to set up a connection, unlike TCP. This makes it faster. It's great for services where speed matters more than perfect data delivery, like live video streaming. A few dropped frames won't ruin a video, but a delay would.

List of UDP Services

Now, let's talk about some services that use UDP:

  1. DNS (Domain Name System): DNS is like the phonebook of the internet. It translates website names into IP addresses. It uses UDP because it needs quick responses.

  2. VoIP (Voice over Internet Protocol): VoIP services, like Skype, use UDP. They need real-time data transfers. A little data loss doesn't affect the call much.

  3. Online Games: Online games need real-time interaction. They can't afford delays, so they use UDP.

  4. Video Streaming: Services like YouTube use UDP for live streaming.

Disadvantages of UDP 

UDP is not perfect. Its main disadvantage is its unreliability. UDP doesn't check if data packets reach their destination. So, some data might get lost or arrive out of order. Also, it doesn't control data flow, so packets may be dropped if the network is busy.

In short, UDP is fast and simple, but it lacks the careful checking that TCP offers.

Differences Between TCP and UDP

Aspects

TCP

UDP

Connection

TCP is a connection-oriented protocol that sets up a dedicated connection before data transfer.

UDP is connectionless. It sends data without setting up a connection.

Speed

TCP is slower as it checks whether each packet is received and is in the correct order.

UDP is faster as it sends packets without waiting to check if they have been received.

Reliability

TCP is highly reliable. It guarantees the packets will reach their destination in the correct order.

UDP doesn't ensure that packets reach their destination. This makes it less reliable for data transmission.

Usage

TCP is used when reliability is important, like loading a webpage or sending an email.

UDP is used when speed is important, like in live video streaming or online gaming.

Flow Control

TCP has flow control, adjusting the data transmission rate based on the receiver's capacity.

UDP lacks flow control, data is sent at a constant rate.

Error Checking

TCP uses error checking and can ask for packets to be sent again if they are corrupted.

UDP does minimal error checking and doesn't request the resending of corrupted packets.

Conclusion

Transport layer protocols like TCP and UDP are vital to making the internet work smoothly. The former ensures reliable data delivery, while the latter offers speed. Choosing the right protocol depends on your needs - reliability or speed. Understanding these protocols helps us appreciate the complex workings of the internet.

FAQs

  1. What are some other transport layer protocols aside from TCP and UDP?

Besides TCP and UDP, there are other protocols like SCTP (Stream Control Transmission Protocol) and DCCP (Datagram Congestion Control Protocol). SCTP ensures reliable data transport, whereas DCCP is a non-reliable datagram stream.

  1. How does TCP handle lost packets?

TCP uses sequence numbers and checksums to detect missing or erroneous packets. If it finds one such case, it asks for that packet to be resent. 

  1. What role does the transport layer play in the OSI model?

In the OSI model, the transport layer is responsible for end-to-end communication between two systems. It handles data transmission, packet segmentation, error control, and flow control.

  1. What's the difference between flow control and congestion control in TCP?

Flow control is about matching the data transmission rate to the receiver's ability to process data. Congestion control prevents network congestion by adjusting how much data is sent into the network.

Leave a Reply

Your email address will not be published. Required fields are marked *