0% found this document useful (0 votes)
7 views35 pages

Chapter 3 Part1

Chapter 3 of 'Computer Networking: A Top-Down Approach' covers the transport layer, focusing on its services, protocols (TCP and UDP), and key concepts like multiplexing, demultiplexing, reliable data transfer, and congestion control. It explains the roles of TCP for reliable, connection-oriented communication and UDP for connectionless, best-effort service. The chapter also details how transport protocols operate at the sender and receiver ends, including the use of checksums for error detection.
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)
7 views35 pages

Chapter 3 Part1

Chapter 3 of 'Computer Networking: A Top-Down Approach' covers the transport layer, focusing on its services, protocols (TCP and UDP), and key concepts like multiplexing, demultiplexing, reliable data transfer, and congestion control. It explains the roles of TCP for reliable, connection-oriented communication and UDP for connectionless, best-effort service. The chapter also details how transport protocols operate at the sender and receiver ends, including the use of checksums for error detection.
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/ 35

Chapter 3

Transport
Layer
Computer Networking: A
Top-Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
Transport Layer: 3-1
Transport layer: overview
Our goal:
 understand  learn about Internet
principles behind transport layer protocols:
transport layer • UDP: connectionless
services: transport
• multiplexing, • TCP: connection-oriented
demultiplexing reliable transport
• reliable data transfer • TCP congestion control
• flow control
• congestion control

Transport Layer: 3-2


Transport layer: roadmap
 Transport-layer services
 Multiplexing and demultiplexing
 Connectionless transport: UDP
 Principles of reliable data transfer
 Connection-oriented transport: TCP
 Principles of congestion control
 TCP congestion control
 Evolution of transport-layer
functionality

Transport Layer: 3-3


Transport services and protocols
application
transport
 provide logical communication mobile
network
network
data link

between application processes


physical
national or global ISP

lo g
running on different hosts

ica
le
 transport protocols actions in end

nd
systems:

-en
• sender: breaks application messages

dt
local or
regional
into segments, passes to network

ra n
ISP
layer

sp
home network content
• receiver: reassembles segments into

ort
provider
messages, passes to application layer network datacenter
application
network
transport
network
 two transport protocols available data link
physical

to Internet applications
enterprise
• TCP, UDP network

Transport Layer: 3-4


Transport vs. network layer services and protocols

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

Transport Layer: 3-5


Transport vs. network layer services and protocols

 network layer: logical household analogy:


communication between hosts 12 kids in Ann’s house sending
 transport layer: logical letters to 12 kids in Bill’s house:
communication between  hosts = houses
processes  processes = kids
• relies on, enhances,  app messages = letters in
network layer services envelopes
 transport protocol = Ann and
Bill who demux to in-house
siblings
 network-layer protocol = postal
service

Transport Layer: 3-6


Transport Layer Actions

Sender:
 is passed an application- app. msg
application
application
layer message
 determines segment TT
hh app. msg
transport
transport header fields values
 creates segment network
network (IP)
 passes segment to IP (IP)
link
link
physical physical

Transport Layer: 3-7


Transport Layer Actions

Receiver:
 receives segment from IP application
application
 checks header values
app. msg
transport  extracts application-layer transport
message
 demultiplexes message network (IP)
network (IP)
up to application via link
link socket
physical physical
T app. msg
h

Transport Layer: 3-8


Two principal Internet transport protocols
application
transport
 TCP: Transmission Control Protocol mobile
network
network
data link

• reliable, in-order delivery physical


national or global ISP

lo g
• congestion control

ica
• flow control

le
• connection setup

nd
-en
 UDP: User Datagram Protocol

dt
local or
• unreliable, unordered delivery regional

ra n
ISP
• no-frills extension of “best-effort” IP

sp
home network content

ort
 services not available: provider
network datacenter
• delay guarantees application
network
transport
network
• bandwidth guarantees data link
physical

enterprise
network

Transport Layer: 3-9


Chapter 3: roadmap
 Transport-layer services
 Multiplexing and demultiplexing
 Connectionless transport: UDP
 Principles of reliable data transfer
 Connection-oriented transport: TCP
 Principles of congestion control
 TCP congestion control
 Evolution of transport-layer
functionality

Transport Layer: 3-10


HTTP server
client
application application
HTTP msg

transport

transport network transport


network link network
link physical link
physical physical

Transport Layer: 3-11


HTTP server
client
application application
HTTP msg

Ht HTTP msg
transport

transport network transport


network link network
link physical link
physical physical

Transport Layer: 3-12


HTTP server
client
application application
HTTP msg

Ht HTTP msg
transport
Hnetwork
nHt
HTTP msg
transport transport
network link network
link physical link
physical physical

Transport Layer: 3-13


HTTP server
client
application application

transport

transport network transport


network link network
link physical link
physical physical

HnHt HTTP msg

Transport Layer: 3-14


HTTP server
client1 client2
application P-client1 P-client2 application

transport

transport network transport


network link network
link physical link
physical physical

Transport Layer: 3-15


Multiplexing/demultiplexing
multiplexing at sender: demultiplexing at receiver:
handle data from multiple use header info to deliver
sockets, add transport header received segments to correct
(later used for demultiplexing) socket

application

application P1 P2 application socket


P3 transport P4
process
transport network transport
network link network
link physical link
physical physical

Transport Layer: 3-16


How demultiplexing works
 host receives IP datagrams
32 bits
• each datagram has source IP
source port # dest port #
address, destination IP address
• each datagram carries one
transport-layer segment other header fields
• each segment has source,
destination port number
 host uses IP addresses & port application
data
numbers to direct segment to (payload)
appropriate socket

TCP/UDP segment format

Transport Layer: 3-17


Connectionless demultiplexing
Recall: when receiving host receives
 when creating socket, must UDP segment:
specify host-local port #: • checks destination port #
DatagramSocket mySocket1 in segment
= new DatagramSocket(12534); • directs UDP segment to
socket with that port #
 when creating datagram to
send into UDP socket, must
specify IP/UDP datagrams with same
• destination IP address dest. port #, but different
• destination port # source IP addresses and/or
source port numbers will be
directed to same socket at
receiving host
Transport Layer: 3-18
Connectionless demultiplexing: an example
DatagramSocket
serverSocket = new
DatagramSocket
DatagramSocket mySocket2 = DatagramSocket mySocket1 =
new DatagramSocket (6428); new DatagramSocket (5775);
(9157); application
application P1 application
P3 P4
transport
transport transport
network
network link network
link physical link
physical physical

source port: 6428 source port: ?


dest port: 9157 dest port: ?

source port: 9157 source port: ?


dest port: 6428 dest port: ?
Transport Layer: 3-19
Connection-oriented demultiplexing

 TCP socket identified  server may support


by 4-tuple: many simultaneous
• source IP address TCP sockets:
• source port number • each socket identified
• dest IP address by its own 4-tuple
• dest port number • each socket associated
 demux: receiver with a different
connecting client
uses all four values
(4-tuple) to direct
segment to
appropriate socket
Transport Layer: 3-20
Connection-oriented demultiplexing: example
application
application P4 P5 P6 application
P1 P2 P3
transport
transport transport
network
network link network
link physical link
physical server: physical
IP
address
B
host: IP source IP,port: B,80 host: IP
address dest IP,port: A,9157 source IP,port: C,5775 address
A dest IP,port: B,80 C
source IP,port: A,9157
dest IP, port: B,80
source IP,port: C,9157
dest IP,port: B,80
Three segments, all destined to IP address: B,
dest port: 80 are demultiplexed to different sockets
Transport Layer: 3-21
Summary
 Multiplexing, demultiplexing: based on segment,
datagram header field values
 UDP: demultiplexing using destination port number (only)
 TCP: demultiplexing using 4-tuple: source and destination
IP addresses, and port numbers
 Multiplexing/demultiplexing happen at all layers

Transport Layer: 3-22


Chapter 3: roadmap
 Transport-layer services
 Multiplexing and demultiplexing
 Connectionless transport: UDP
 Principles of reliable data transfer
 Connection-oriented transport:
TCP
 Principles of congestion control
 TCP congestion control
 Evolution of transport-layer
functionality

Transport Layer: 3-23


UDP: User Datagram Protocol
Why is there a UDP?
 “no frills,” “bare bones”
Internet transport protocol  no connection
 “best effort” service, UDP establishment (which can
add RTT delay)
segments may be:
 simple: no connection
• lost
state at sender, receiver
• delivered out-of-order to app  small header size
 no congestion control
 connectionless:  UDP can blast away as
fast as desired!
• no handshaking between UDP
 can function in the face
sender, receiver
of congestion
• each UDP segment handled
independently of others
Transport Layer: 3-24
UDP: User Datagram Protocol
 UDP use:
 streaming multimedia apps (loss tolerant, rate sensitive)
 DNS
 SNMP
 HTTP/3
 if reliable transfer needed over UDP (e.g., HTTP/3):
 add needed reliability at application layer
 add congestion control at application layer

Transport Layer: 3-25


UDP: User Datagram Protocol [RFC 768]

Transport Layer: 3-26


UDP: Transport Layer Actions

SNMP client SNMP server

application application

transport transport
(UDP) (UDP)
network (IP)
network (IP)
link link

physical physical

Transport Layer: 3-27


UDP: Transport Layer Actions

SNMP client UDP sender actions: SNMP server


 is passed an application- SNMP msg
application
application
layer message
transport  determines UDP segment transport
UDP SNMP msg
h

(UDP) header fields values (UDP)


 creates UDP segment network
network (IP)
 passes segment to IP (IP)
link
link
physical physical

Transport Layer: 3-28


UDP: Transport Layer Actions

SNMP client UDP receiver actions: SNMP server


 receives segment from IP application
application
 checks UDP checksum
transport header value transport
SNMP msg
(UDP)  extracts application-layer (UDP)
message
UDP SNMP msg
network (IP) network
h
 demultiplexes message
(IP)
link
link up to application via
socket
physical physical

Transport Layer: 3-29


UDP segment header
32 bits
source port # dest port #
length checksum

application length, in bytes of


data UDP segment,
(payload) including header

data to/from
UDP segment format application layer

Transport Layer: 3-30


UDP checksum
Goal: detect errors (i.e., flipped bits) in transmitted
segment
1st number 2nd number sum

Transmitted: 5 6 11

Received: 4 6 11

receiver-computed
checksum
= sender-computed
checksum (as received)

Transport Layer: 3-31


UDP checksum
Goal: detect errors (i.e., flipped bits) in transmitted segment

sender: receiver:
 treat contents of UDP  compute checksum of received
segment (including UDP segment
header fields and IP
addresses) as sequence of  check if computed checksum equals
16-bit integers checksum field value:
 checksum: addition (one’s • Not equal - error detected
complement sum) of • Equal - no error detected. But
segment content maybe errors nonetheless? More
 checksum value put into UDP later ….
checksum field

Transport Layer: 3-32


Internet checksum: an example
example: add two 16-bit integers
1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1

sum 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1

Note: when adding numbers, a carryout from the most significant


bit needs to be added to the result

Transport Layer: 3-33


Internet checksum: weak protection!

example: add two 16-bit integers


0 1
1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0
1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 Even though
numbers have
changed (bit
sum 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 flips), no
checksum 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 change in
checksum!

Transport Layer: 3-34


Summary: UDP
 “no frills” protocol:
• segments may be lost, delivered out of order
• best effort service: “send and hope for the best”
 UDP has its plusses:
• no setup/handshaking needed (no RTT incurred)
• can function when network service is compromised
• helps with reliability (checksum)
 build additional functionality on top of UDP in application layer (e.g.,
HTTP/3)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy