0% found this document useful (0 votes)
4 views13 pages

Unit 5

The document covers the Transport and Application Layer in networking, detailing key concepts such as the client-server paradigm, TCP and UDP protocols, flow control, and various application layer protocols like HTTP and FTP. It explains the differences between TCP and UDP, emphasizing TCP's reliability and connection-oriented service, while UDP is noted for its speed and connectionless nature. Additionally, it includes numerical problems related to TCP sequence numbers, flow control, and subnetting to reinforce the concepts discussed.

Uploaded by

amrita6025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views13 pages

Unit 5

The document covers the Transport and Application Layer in networking, detailing key concepts such as the client-server paradigm, TCP and UDP protocols, flow control, and various application layer protocols like HTTP and FTP. It explains the differences between TCP and UDP, emphasizing TCP's reliability and connection-oriented service, while UDP is noted for its speed and connectionless nature. Additionally, it includes numerical problems related to TCP sequence numbers, flow control, and subnetting to reinforce the concepts discussed.

Uploaded by

amrita6025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

✅ Unit 5 – Transport and Application Layer

📘 Section A – Very Short Answer (2 Marks)


1.​ What is the main function of the Transport Layer?​
➤ To provide process-to-process delivery of data between software applications
running on different hosts.​

2.​ What is a client-server paradigm?​


➤ It is a communication model where a client requests services and the server
responds (e.g., web browser and web server).​

3.​ Define connection-oriented service.​


➤ A service that establishes a connection first before data transfer (e.g., TCP).​

4.​ Define connectionless service.​


➤ A service where data is sent without any prior connection (e.g., UDP).​

5.​ What is flow control?​


➤ A technique used to prevent sender from overwhelming the receiver by
controlling the data flow rate.​

6.​ What is the purpose of TCP?​


➤ TCP (Transmission Control Protocol) ensures reliable, ordered, and
error-checked delivery of data.​

7.​ What is UDP used for?​


➤ UDP (User Datagram Protocol) is used for fast, connectionless communication
where speed is preferred over reliability, such as video streaming.​

8.​ Name any two Application Layer protocols.​


➤ HTTP and FTP.​

9.​ What is the difference between TCP and UDP in one line?​
➤ TCP is reliable and connection-oriented, while UDP is faster and
connectionless.​

10.​What does the Application Layer do?​


➤ It provides services directly to users (e.g., email, file transfer, web access).​

11.​What is the full form of HTTP?​


➤ HyperText Transfer Protocol​

12.​What is the full form of FTP?​


➤ File Transfer Protocol​

✅ Unit 5 – Transport and Application Layer


📘 Section B – Short Answer (3–5 Marks)
1. Explain the client-server paradigm with an example.

✅ Definition:​
The client-server paradigm is a network architecture where one machine (client) requests
services or data from another machine (server) that provides those services.

✅ How it works:
●​ The client initiates communication.​

●​ The server listens and responds to requests.​

●​ Common in web browsing, email, file sharing, etc.​

✅ Example:
●​ When you open a browser and visit www.google.com:​

○​ Your browser (client) sends a request.​

○​ Google’s server processes it and sends back the webpage.​

✅ Real-Life Examples:
Client Server

Web browser Web server (Apache, Nginx)

Email app Mail server (Gmail, Outlook)

File Transfer FTP server


app

2. Compare TCP and UDP protocols.


Feature TCP UDP

Type Connection-oriented Connectionless

Reliability Reliable (ensures delivery & Unreliable (no guarantee of


order) delivery)

Speed Slower (due to error checking) Faster (less overhead)

Use Case File transfer, web, email Video streaming, gaming, VoIP

Flow Control Yes No

Error Checking Yes Optional (checksum only)

✅ Conclusion:​
Use TCP when accuracy is critical. Use UDP when speed is more important than accuracy.
3. Explain the concept of flow control in transport layer.

✅ Definition:​
Flow control is a technique used to manage the rate of data transmission between
sender and receiver.

✅ Why Needed?​
To prevent the sender from overwhelming the receiver, especially if the receiver
processes data slowly.

✅ Types of Flow Control:


1.​ Stop-and-Wait:​

○​ Sender sends one frame, waits for acknowledgment before sending the next.​

2.​ Sliding Window:​

○​ Sender can send multiple frames before needing acknowledgment.​

○​ Window size controls how many frames can be sent at once.​

✅ Used In:​
TCP uses sliding window protocol for efficient flow control.

4. Write a short note on UDP.

✅ Full Form:​
User Datagram Protocol

✅ Features:
●​ Connectionless: No setup required before data transfer.​

●​ Unreliable: No guarantee of delivery or order.​

●​ Fast and lightweight​

✅ Use Cases:
●​ Live video/audio streaming​

●​ Online games​
●​ VoIP (Voice over IP)​

●​ DNS (Domain Name System)​

✅ Structure:​
UDP packet has a simple header:

●​ Source port​

●​ Destination port​

●​ Length​

●​ Checksum​

5. Mention any 3 Application Layer protocols and their use.


Protoco Full Form Use
l

HTTP HyperText Transfer Protocol Browsing websites (e.g., www.google.com)

FTP File Transfer Protocol Uploading/downloading files from servers

SMTP Simple Mail Transfer Protocol Sending emails

Great! Here's the detailed explanation for:

✅ Unit 5 – Transport and Application Layer


📘 Section C – Long Answer (8–10 Marks)
1. Explain TCP in detail. How does it ensure reliable data delivery?

✅ Full Form: Transmission Control Protocol​


✅ Type: Connection-oriented, reliable transport layer protocol
🔸 Key Features of TCP:
●​ Reliable data delivery using acknowledgments​

●​ Connection establishment using 3-way handshake​

●​ Ordered data transfer (data arrives in same order as sent)​

●​ Error checking and correction​

●​ Flow control (using sliding window protocol)​

●​ Congestion control (to avoid network overload)​

🔸 Working of TCP:
Connection Establishment – 3-Way Handshake:​

Client Server
|---SYN---->|
|<--SYN+ACK-|
|---ACK---->|

1.​
○​ Client sends SYN to start.​

○​ Server responds with SYN + ACK.​

○​ Client sends ACK to confirm.​

○​ Now the connection is established.​

2.​ Data Transmission:​

○​ Data is broken into segments.​

○​ Each segment has a sequence number.​

○​ Receiver sends ACK for received data.​

○​ If ACK is not received, TCP retransmits data.​

Connection Termination – 4-Step Process:​



Client Server
|---FIN---->|
|<--ACK-----|
|<--FIN-----|
|---ACK---->|

3.​

🔸 Diagram – TCP Header:


| Source Port | Destination Port |
| Sequence Number |
| Acknowledgment Number |
| Header Length | Flags |
| Window Size |
| Checksum |
| Urgent Pointer |

🔸 Why TCP is Reliable?


Mechanism Role

Sequence Tracks order of data


Numbers

Acknowledgments Confirms receipt

Retransmission Resends lost packets

Flow Control Prevents receiver overflow

Congestion Control Avoids overloading the network

2. Describe the Application Layer and explain any 3 protocols.

✅ Application Layer:​
Top-most layer in OSI model. Provides user interface and services for network
communication.

✅ Role:
●​ Supports process-to-process communication​

●​ Provides network services to applications like web, email, file transfer​

🔸 Common Application Layer Protocols:


Protocol Full Form Function

HTTP HyperText Transfer Web browsing, transferring web pages


Protocol

FTP File Transfer Protocol Uploading/downloading files

SMTP Simple Mail Transfer Sending emails


Protocol

DNS Domain Name System Converts domain names to IP


addresses

DHCP Dynamic Host Assigns IP addresses automatically


Configuration

🔸 Example – HTTP Communication:


Client (Browser) Server (Website)
|--------GET /index.html-------->|
|<------200 OK + webpage data----|

●​ Browser sends GET request.​

●​ Server responds with page content.​

Sure! Here are some numericals related to Unit 5: Transport and Application Layer,
focusing on concepts like TCP sequence numbers, flow control, and basic IP addressing
relevant to the transport/application layer.

🔢 Numericals for Unit 5 – Transport and Application


Layer

1. TCP Sequence Number Calculation

●​ A TCP connection starts with an initial sequence number (ISN) of 1000.​


●​ The sender sends 3 segments of data with payload sizes: 500 bytes, 1000 bytes, and
200 bytes.​

●​ What will be the sequence number of the next byte to be sent after these three
segments?​

Solution:

●​ After first segment: 1000 + 500 = 1500​

●​ After second segment: 1500 + 1000 = 2500​

●​ After third segment: 2500 + 200 = 2700​

Answer: The next sequence number will be 2700.

2. Sliding Window Protocol (Flow Control)

●​ Window size is 4 segments.​

●​ Sender has sent segments with sequence numbers 1, 2, 3, 4.​

●​ Receiver acknowledges segments 1 and 2.​

●​ How many segments can the sender send now without waiting for more ACKs?​

Solution:

●​ Window size = 4 segments​

●​ Sender sent 4 segments and got ACK for 2 segments.​

●​ So, sender can send 2 more segments to keep the window full.​

Answer: Sender can send 2 more segments.

3. Calculate Time for TCP 3-Way Handshake

●​ Round-trip time (RTT) between client and server is 100 ms.​


●​ How much time will it take to establish a TCP connection using 3-way handshake?​

Solution:

●​ The handshake consists of 3 steps: SYN, SYN-ACK, ACK.​

●​ SYN and SYN-ACK happen during 1 RTT.​

●​ ACK is sent immediately after SYN-ACK without waiting for another RTT.​

Answer: It takes about 1 RTT = 100 ms to establish the connection.

4. IP Address and Port Number

●​ A client uses IP address 192.168.1.5 and port number 4500 to communicate with a
server IP 172.16.5.10 on port 80.​

●​ What is the socket address of the client and the server?​

Solution:

●​ Client socket: 192.168.1.5:4500​

●​ Server socket: 172.16.5.10:80​

5. Calculate the Data Rate in FTP Transfer

●​ A file of size 50 MB is transferred over FTP in 20 seconds.​

●​ Calculate the data transfer rate in Mbps.​

Solution:

●​ File size = 50 MB = 50 × 8 = 400 Megabits​

●​ Time = 20 seconds​

●​ Data rate = 400 Mb / 20 s = 20 Mbps​


Answer: Data transfer rate is 20 Mbps.

Great! Here are some numericals with step-by-step solutions on Subnetting and TCP
Sliding Window (Flow Control) — both very important for networking exams.

🔢 Subnetting Numericals
Numerical 1: Find the number of subnets and hosts per subnet

●​ Given IP address: 192.168.10.0​

●​ Subnet mask: 255.255.255.240​

Step 1: Convert subnet mask to binary and find number of subnet bits

●​ 255.255.255.240 in binary:​
11111111.11111111.11111111.11110000​

●​ Number of 1’s in subnet mask = 28 bits​

●​ Default Class C mask is 24 bits → borrowed bits = 28 - 24 = 4 bits​

Step 2: Calculate number of subnets

●​ Number of subnets = 2^borrowed bits = 2^4 = 16 subnets​

Step 3: Calculate number of hosts per subnet

●​ Host bits = 32 - 28 = 4 bits​

●​ Number of hosts per subnet = 2^host bits - 2 = 2^4 - 2 = 14 hosts​

Answer:

●​ Number of subnets = 16​

●​ Number of hosts per subnet = 14​


Numerical 2: Find the subnet ID and broadcast address

●​ IP address: 192.168.5.65​

●​ Subnet mask: 255.255.255.192​

Step 1: Find subnet mask in binary

●​ 255.255.255.192 = 11111111.11111111.11111111.11000000​

●​ Mask length = 26 bits (24 + 2 borrowed bits)​

Step 2: Calculate block size

●​ Block size = 256 - last octet subnet mask value = 256 - 192 = 64​

Step 3: Find subnet ranges

●​ Subnets start at 0, 64, 128, 192...​

●​ IP 192.168.5.65 lies in the subnet starting at 64​

Step 4: Calculate broadcast address

●​ Broadcast = subnet start + block size - 1 = 64 + 64 - 1 = 127​

Answer:

●​ Subnet ID: 192.168.5.64​

●​ Broadcast address: 192.168.5.127​

🔢 TCP Sliding Window Numericals


Numerical 1: Window Size and ACKs
●​ Window size = 5​

●​ Sender sends segments with sequence numbers 1, 2, 3, 4, 5​

●​ Receiver ACKs segment 3​

●​ How many new segments can the sender send?​

Solution:

●​ If receiver acknowledges segment 3, the window slides forward​

●​ Segments 1, 2, 3 are acknowledged​

●​ Sender can send segments 6 and 7 (two more to keep window size 5)​

Answer: Sender can send 2 new segments.

Numerical 2: Calculate effective window size

●​ Sequence numbers range: 0 to 7 (3-bit sequence number)​

●​ If the sender has sent segments with seq numbers 0, 1, 2 and received ACK for 1,​

●​ What is the current effective window size?​

Solution:

●​ Maximum sequence number = 7​

●​ Window size can be max (max seq + 1)/2 = (7 + 1)/2 = 4​

●​ After ACK 1, sender can send seq 3 and 4​

●​ Effective window size is 4 segments​

You might also like