Nothing Special   »   [go: up one dir, main page]

Lec 3 - Transport Layer - I

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Computer and

Communication Networks
EE-357
By Dr Mir Yasir Umair
Associate Professor, MCS, NUST
Transport Layer
Chap 03
Chapter 3: Transport Layer
our goals:
 understand principles behind transport layer
services:
 multiplexing, demultiplexing
 reliable data transfer
 flow control
 congestion control

Transport Layer 3-3


Chapter 3: Transport Layer
 learn about Internet transport layer protocols:
 UDP: connectionless transport
 TCP: connection-oriented reliable transport
 TCP congestion control
Transport services and protocols
application
transport
network

 provide logical communication between data link


physical

app processes running on different hosts

lo
 transport protocols run in end systems

gi
ca
enl
 send side: breaks app messages into segments, passes to

d-
network layer

en
d
 rcv side: reassembles segments into messages, passes to

tra
ns
app layer

po
rt
 more than one transport protocol
available to apps application
transport
network
 Internet: TCP and UDP data link
physical

Transport Layer 3-5


Transport Layer
Sender’s side: - breaks application layer messages into segments,
appends header and passes them to network layer – Multiplexing

Receiving side: - Reassembles segments into messages, use header to


deliver data to the correct process/ service - Demultiplexing
Transport vs. network layer
network layer: logical communication between
hosts
transport layer: logical communication between
processes
 relies on, enhances, network layer services

Transport Layer 3-7


Household analogy
12 kids in Ann’s house sending letters to 12 kids in Bill’s house:
• hosts = houses
• processes = kids
• app messages = letters in envelopes
• transport protocol = Ann and Bill who demux to in-house siblings
• network-layer protocol = postal service
Internet transport-layer protocols
application
• reliable, in-order delivery transport
network
data link
(TCP) physical
network
o congestion control network data link

lo
data link physical

gi
o flow control physical

ca
network

l
o connection setup data link

en
physical

d-
• unreliable, unordered

en
network

d
data link

tra
delivery: UDP physical

ns
po
network
o no-frills extension of “best-effort” IP

rt
data link
physical
• services not available: network
data link application
physical transport
o delay guarantees network
network
data link
o bandwidth guarantees physical data link
physical

Transport Layer 3-9


Telephone Analogy
A telephone call over a “telephony network” works as follows:

• Both parties have a telephone installed.


• A phone number is assigned to each telephone.
• Turn on ringer to listen for a caller.
• Caller lifts telephone and dials a number.
• Telephone rings and the receiver of the call picks it up.
• Both Parties talk and exchange data.
• After conversation is over they hang up the phone.
In the world of sockets……
• Socket() – Endpoint for communication
• Bind() - Assign a unique telephone number.
• Listen() – Wait for a caller.
• Connect() - Dial a number.
• Accept() – Receive a call.
• Send(), Recv() – Talk.
• Close() – Hang up.
Dissecting the Analogy
A network application works as follows:

• An endpoint (telephone) for communication is created on both ends.


• An address (phone no) is assigned to both ends to distinguish them
from the rest of the network.
• One of the endpoints (caller) initiate a connection to the other.
• The other end (receiver) point waits for the communication to start.
• Once a connection has been made, data is exchanged (talk).
• Once data has been exchanged the endpoints are closed (hang up).
Major Transport-layer Protocols
• UDP - (User Datagram Protocol)
o Connectionless Protocol
o Unreliable Delivery No acknowledgments & retransmissions
o Integrity Checking To detect corrupted data

• TCP – (Transmission Control Protocol)


o Connection Oriented Set-up and tear-down of TCP session
o Reliable Delivery
o Integrity Checking
o Congestion Control Adapt to network congestion
o Flow Control Prevent overflow of the receiver’s buffer space

Services not available: Delay and Bandwidth guarantees


TCP vs. UDP
Q: Which protocol is better ?
A: It depends on the application.

TCP provides a connection-oriented, reliable byte stream


service (lots of overhead).

UDP offers minimal datagram delivery service (as little


overhead as possible).
Why Would Anyone Use UDP?
• Finer control over what data is sent and when
o As soon as an application process writes into the socket, UDP packages the data and forwards
the segment to next layer.
o TCP throttles the sender incase the link is excessively congested. TCP will also continue to
resend a segment until destination acknowledges the receipt.
o Real-time applications use UDP since they do not want to overly delay segment and can tolerate
some data loss

• No delay for connection establishment


o UDP just blasts away without any formal preliminaries which avoids introducing any
unnecessary delays

• No connection state
o Unlike TCP, there is no allocation of buffers, parameters, sequence #s etc, hence making it
easier to handle many active clients at once.

• Small packet header overhead (UDP 8-bytes long, TCP 20 bytes)


Internet Applications and
Underlying Protocols
Before we Go further
• Transport Layer has four major tasks –

1. Delivery service to the processes


2. Reliability
3. Flow rate
4. Congestion control
Thank you

You might also like