Download Understanding Transport Layer Services and Protocols: TCP and UDP and more Study Guides, Projects, Research Operating Systems in PDF only on Docsity!
Chapter 5
Transport Layer Introduction
Networking
CS 3470, Section 1
Chapter 5: Transport Layer
Our goals:
understand principles
behind transport layer
services:
multiplexing/demultiple
xing
reliable data transfer
flow control
congestion control
learn about transport
layer protocols in the
Internet:
UDP: connectionless
transport
TCP: connection-
oriented transport
TCP congestion
control
Transport services and protocols
provide logical communication
between app processes
running on different hosts
transport protocols run in end
systems
send side: breaks app messages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer
more than one transport
protocol available to apps
Internet: TCP and UDP
application transport network data link physical
application transport network data link physical
network data link physical
network data link physical
network data link physical
network data link data linknetwork physical physical
Transport vs. network layer
Why can’t we just use the network layer to
send messages from host to host?
End-to-end Protocols
Typical limitations of the network on which
transport protocol will operate
Drop messages
Reorder messages
Deliver duplicate copies of a given message
Limit messages to some finite size
Deliver messages after an arbitrarily long delay
Internet transport-layer protocols
reliable, in-order
delivery (TCP)
congestion control
flow control
connection setup
unreliable, unordered
delivery: UDP
no-frills extension of
“best-effort” IP
services not available:
delay guarantees
bandwidth guarantees
application transport network data link physical
application transport network data link physical
network data link physical
network data link physical
network data link physical
network data link data linknetwork physical physical
UDP: User Datagram Protocol
[RFC 768]
Why is there a UDP?
no connection establishment (which can add
delay)
simple: no connection state at sender, receiver
small segment header
no congestion control: UDP can blast away as
fast as desired
10
UDP: more
often used for streaming multimedia apps loss tolerant rate sensitive
other UDP uses
DNS
SNMP
reliable transfer over UDP: add reliability at application layer application-specific error recovery!
source port # (^) dest port #
32 bits
Application data (message)
UDP segment format
length checksum
Length, in bytes of UDP segment, including header
Internet Checksum Example
Note
When adding numbers, a carryout from the most
significant bit needs to be added to the result
Example: add two 16-bit integers
wraparound
sum checksum
Internet Checksum Example
What if we are adding three numbers?
Add first two numbers
Deal with carryout from most significant bit (if necessary)
Add sum of first two numbers with third number
Deal with carryout from most significant bit (if necessary)
Obtain the 1’s compliment by converting all 0s to
1s and all 1s to 0s (flip the bits)
Same general algorithm for adding > 3
numbers
14
Internet Checksum Example
UDP checksum takes as input:
UDP header
Contents of message body
Pseudoheader
3 fields from the IP packet: protocol number, src IP address, dst IP address UDP length field
Motivation of the pseudoheader is to verify
this message has been delivered between
correct two endpoints
16
Reliable Byte Stream (TCP)
In contrast to UDP, Transmission Control
Protocol (TCP) offers the following services
Reliable
Connection oriented
Byte-stream service
End-to-end Issues
At the heart of TCP is the sliding window
algorithm (discussed in Chapter 2)
As TCP runs over the Internet rather than a
point-to-point link, the following issues need to be addressed by the sliding window algorithm
TCP supports logical connections between
processes that are running on two different
computers in the Internet
TCP connections are likely to have widely different
RTT times
Packets may get reordered in the Internet
End-to-end Issues
TCP needs a mechanism using which each side of a
connection will learn what resources the other side is
able to apply to the connection
TCP needs a mechanism using which the sending
side will learn the capacity of the network