Mada za sehemu hiiDemonstrate understanding of computer networksMada 7
- Demonstrate understanding of OSI and TCP/IP Reference models, transmission media, wireless transmission, the public switched telephone networks, mobile telephone system and Network protocols (HTTP, FTP, IP, PPP, etc)
- Develop understanding of Data link layer (Switched LANs: Link-Layer Addressing and ARP, Ethernet, Link-Layer Switches, VLANs)
- Create a network that make use of wireless or Ethernet technology
- Develop understanding of Network layer (design issues, routing algorithms, Congestion control algorithms, Internetworking, the network layer in the internet (IPv4 and IPv6), Quality of Service)
- Elaborate the transport layer (Transport service, elements of transport protocol, Simple Transport Protocol, Internet transport layer protocols: UDP and TCP)
- Describe the application layer (Domain name system, electronic mail, World Wide Web: architecture; dynamic web document and http)
- Apply network security principles, tools and protocols in computer networks
The Transport Layer
The Transport layer is the fourth layer in the OSI model. It is responsible for providing end-to-end data delivery services, managing the reliable transport of data between devices, and ensuring that data reaches the correct application. While lower layers (Network, Data Link, Physical) are concerned with moving data between devices, the Transport layer focuses on getting data from the source application to the destination application.
The Transport layer performs several critical functions in network communication:
1.1 Segmentation and Reassembly
Applications generate data as continuous streams, but networks transmit data in smaller units called segments (when TCP is used) or datagrams (when UDP is used). The Transport layer breaks large data streams into smaller, manageable segments for efficient transmission. At the receiving end, the Transport layer reassembles these segments back into the original data stream.
1.2 End-to-End Communication
The Transport layer provides logical communication between end systems (source and destination computers), not between intermediate devices like routers. It ensures that data passes correctly from one host to another, regardless of how many networks or routers exist between them.
1.3 Multiplexing
Multiple applications on a single computer can communicate over a network simultaneously. The Transport layer uses port numbers to distinguish between these applications:
- Source Port: Identifies the sending application
- Destination Port: Identifies the receiving application
This process is called multiplexing, allowing a single host to have multiple network connections.
1.4 Addressing
Port numbers, combined with IP addresses, create a unique socket for each communication session. For example, a web browser connecting to a server uses a source port (e.g., 49152) and destination port 80 (for HTTP).
The Transport layer can provide two types of service depending on the protocol used:
2.1 Connection-Oriented Service
This service establishes a logical connection before data transmission begins. It guarantees:
- Reliable delivery: Data arrives without errors
- Ordered delivery: Data arrives in the exact sequence sent
- Error correction: Lost or corrupted data is retransmitted
Example: TCP (Transmission Control Protocol) provides connection-oriented service.
2.2 Connectionless Service
This service sends data without establishing a connection first. There is no guarantee of delivery, ordering, or error correction.
Example: UDP (User Datagram Protocol) provides connectionless service.
To achieve reliable data delivery, transport protocols implement several mechanisms:
3.1 Virtual Circuit Setup
In connection-oriented transport, a virtual circuit must be established before data transfer. This involves a process called the three-way handshake:
- SYN: The sender sends a synchronize segment to request connection
- SYN-ACK: The receiver acknowledges and synchronizes back
- ACK: The sender confirms the connection
This exchange ensures both parties are ready to communicate.
3.2 Sequencing
Each data segment is assigned a sequence number. This allows the receiver to:
- Reassemble segments in the correct order
- Identify missing segments for retransmission
- Prevent duplicate segments from being processed
The receiving host examines sequence numbers to reorder segments correctly before passing data to the application.
3.3 Acknowledgments
When the receiver successfully obtains a data segment, it sends an acknowledgment (ACK) back to the sender. If the sender does not receive an ACK within a timeout period, it retransmits the segment.
This mechanism is called Positive Acknowledgment with Retransmission (PAR).
3.4 Flow Control
Flow control prevents the sender from overwhelming the receiver with too much data. The receiver has a limited buffer size, and if the sender transmits too fast, data may be lost.
Techniques include:
- Buffering: Excess data is temporarily stored in memory
- Windowing: The sender transmits multiple segments before waiting for acknowledgments
- Congestion avoidance: Regulates data flow to prevent network overload
The Transmission Control Protocol (TCP) is the primary connection-oriented transport protocol. It provides reliable, ordered, error-checked delivery of data between applications.
4.1 TCP Header Structure
A TCP segment includes:
- Source Port (16 bits)
- Destination Port (16 bits)
- Sequence Number (32 bits)
- Acknowledgment Number (32 bits)
- Flags (SYN, ACK, FIN, RST, PSH, URG)
- Window Size (16 bits)
- Checksum (16 bits)
- Urgent Pointer (16 bits)
4.2 How TCP Works
Step 1: Connection Establishment (Three-way Handshake)
Sender → SYN (seq=x) → Receiver
Sender ← SYN-ACK (seq=y, ack=x+1) ← Receiver
Sender → ACK (ack=y+1) → Receiver
Step 2: Data Transfer
- Sender transmits segments with sequence numbers
- Receiver sends ACKs confirming receipt
- If ACK is not received, sender retransmits
Step 3: Connection Termination
Sender → FIN → Receiver
Sender ← ACK ← Receiver
Sender ← FIN ← Receiver
Sender → ACK → Receiver
4.3 Flow Control in TCP
TCP uses a sliding window mechanism:
- The window size determines how many bytes can be sent before requiring an ACK
- The receiver advertises its receive window (rwnd) to the sender
- If the window reaches zero, the sender stops transmitting until buffer space opens
4.4 Congestion Control in TCP
TCP implements several algorithms to prevent network congestion:
- Slow Start: Begins with a small window, exponentially increases
- Congestion Avoidance: Additive increase of window size
- Fast Retransmit: Retransmits after three duplicate ACKs
- Fast Recovery: Continues after fast retransmit
The User Datagram Protocol (UDP) is a simpler protocol that does not establish connections before sending data.
5.1 Characteristics of UDP
- No connection setup: Data is sent immediately
- No acknowledgments: No confirmation of delivery
- No sequencing: Packets may arrive out of order
- No flow control: Sender can overwhelm receiver
- No congestion control: May contribute to network congestion
5.2 UDP Header Structure
UDP has a much simpler header than TCP:
- Source Port (16 bits)
- Destination Port (16 bits)
- Length (16 bits)
- Checksum (16 bits)
5.3 Why Use UDP?
UDP is faster and has less overhead because it does not perform error recovery, sequencing, or flow control. It is suitable for applications where:
- Speed is critical (real-time audio, video streaming)
- Occasional data loss is acceptable
- Error handling is done at the application layer
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Delivery | Guaranteed delivery | No guarantee |
| Reliability | Reliable | Unreliable |
| Order | Preserves order | No order preservation |
| Overhead | Higher (20-60 bytes) | Lower (8 bytes) |
| Speed | Slower | Faster |
| Header Size | 20-60 bytes | 8 bytes |
| Acknowledgment | Yes | No |
| Flow Control | Yes | No |
| Error Checking | Yes | Limited (checksum) |

Scenario: A student in Dar es Salaam opens a web browser to visit a website hosted on a server in Mwanza.
Step-by-step:
-
Client (browser) sends SYN:
- Sets SYN flag = 1
- Generates Initial Sequence Number (ISN), for example, 1000
- Segment:
SYN, seq=1000
-
Server responds with SYN-ACK:
- Sets SYN = 1, ACK = 1
- Acknowledges client's ISN:
ack=1001 - Generates its own ISN, for example, 2500
- Segment:
SYN-ACK, seq=2500, ack=1001
-
Client sends ACK:
- Sets ACK = 1
- Acknowledges server's ISN:
ack=2501 - Segment:
ACK, seq=1001, ack=2501
Now the TCP connection is established, and data transfer can begin.
When you use mobile money (M-Pesa) to send money from your phone, both TCP and UDP play roles behind the scenes. The initial login and authentication use TCP to ensure your credentials are reliably transmitted and acknowledged. However, for real-time transaction notifications that must arrive instantly, UDP is often used to reduce delay—ensuring you see the message that money was sent immediately, even if the occasional notification is lost. This combination of reliable connection-oriented communication for critical data and fast connectionless communication for timely updates is how the Transport layer enables Tanzania's mobile money systems to function effectively.
Swali
What is the primary responsibility of the Transport layer in the OSI model?
Ingia ili kuwasilisha jibu lako na lihesabiwe katika umahiri wako.
Ingia ili kufanya mazoeziMwalimu
Umekwama? Niulize chochote kuhusu mada hii.
Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu swali hili.
Ingia ili kuuliza