0% found this document useful (0 votes)
14 views18 pages

Understanding Transport Layer Protocols

Uploaded by

twatiubai
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)
14 views18 pages

Understanding Transport Layer Protocols

Uploaded by

twatiubai
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

Chapter 3

Transport Layer

Computer
Networking: A Top
Lecture 5 Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012

Transport Layer 3-1


Chapter 3: Transport Layer
our goals:
 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
 flow control
 congestion control

Transport Layer 3-2


Chapter 3 outline
3.1 transport-layer 3.5 connection-oriented
services transport: TCP
3.2 multiplexing and  segment structure
demultiplexing  reliable data transfer
3.3 connectionless  flow control
transport: UDP  connection management
3.4 principles of reliable
data transfer

Transport Layer 3-3


Transport services and protocols
application
transport
 provide logical communication network
data link
between app processes physical

running on different hosts


 transport protocols run in
end systems
 send side: breaks app
messages into segments,
passes to network layer
 rcv side: reassembles application
segments into messages, transport
network
passes to app layer data link
physical

 more than one transport


protocol available to apps
 Internet: TCP and UDP
Transport Layer 3-4
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-5


Internet transport-layer protocols
application
 reliable, in-order delivery transport
network

(TCP) data link


physical
network
(TCP ensures that data is delivered from network
data link
data link
physical
sending process to receiving process, physical
network
correctly and in order.) data link
physical
 congestion control network

 flow control data link


physical
network
 connection setup data link
physical

unreliable, unordered
network
 data link
physical
application
transport
delivery: UDP network
data link
physical
network
data link
physical
 services not available:
 delay guarantees
 bandwidth guarantees
Transport Layer 3-6
Chapter 3 outline
3.1 transport-layer 3.5 connection-oriented
services transport: TCP
3.2 multiplexing and  segment structure
demultiplexing  reliable data transfer
3.3 connectionless  flow control
transport: UDP  connection management
3.4 principles of reliable 3.6 principles of congestion
data transfer control
3.7 TCP congestion control

Transport Layer 3-7


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-8


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

Transport Layer 3-9


Chapter 3 outline
3.1 transport-layer 3.5 connection-oriented
services transport: TCP
3.2 multiplexing and  segment structure
demultiplexing  reliable data transfer
3.3 connectionless  flow control
transport: UDP  connection management
3.4 principles of reliable 3.6 principles of congestion
data transfer control
3.7 TCP congestion control

Transport Layer 3-10


UDP: User Datagram Protocol [RFC 768]
 “best effort” service,  UDP use:
UDP segments may be:  streaming multimedia
 lost apps (loss tolerant, rate
 delivered out-of-order sensitive)
to app  DNS
 connectionless:
 no handshaking  reliable transfer over
between UDP sender, UDP:
receiver
 add reliability at
 each UDP segment application layer
handled independently
of others  application-specific error
recovery!

Transport Layer 3-11


UDP: segment header
length, in bytes of
32 bits UDP segment,
source port # dest port # including header

length checksum
why is there a UDP?
 no connection
application establishment (which can
data add delay)
(payload)  simple: no connection
state at sender, receiver
 small header size
UDP segment format  no congestion control

Transport Layer 3-12


UDP checksum
Goal: detect “errors” (e.g., flipped bits) in transmitted
segment
sender: receiver:
 treat segment contents,  compute checksum of received
including header fields, as segment
sequence of 16-bit integers  check if computed checksum
 checksum: addition (one’s equals checksum field value:
complement sum) of segment
contents  NO - error detected
 The one’s complement is  YES - no error detected. But
obtained by converting all the maybe errors nonetheless? More
0s to 1s and converting all the later ….
1s to 0s
 sender puts checksum value
into UDP checksum field

Transport Layer 3-13


Internet checksum: example
example: add two 16-bit integers
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 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 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 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-14


Chapter 3 outline
3.1 transport-layer 3.5 connection-oriented
services transport: TCP
3.2 multiplexing and  segment structure
demultiplexing  reliable data transfer
3.3 connectionless  flow control
transport: UDP  connection management
3.4 principles of reliable 3.6 principles of congestion
data transfer control
3.7 TCP congestion control

Transport Layer 3-15


TCP: Overview RFCs: 793,1122,1323, 2018, 2581

 point-to-point:  full duplex data:


 one sender, one receiver  bi-directional data flow
 reliable, in-order byte in same connection
steam:  connection-oriented:
 no “message  handshaking (exchange
boundaries” of control msgs) inits
sender, receiver state
 pipelined: before data exchange
 TCP congestion and
flow control set window  flow controlled:
size  sender will not
overwhelm receiver

Transport Layer 3-16


TCP segment structure
32 bits
URG: urgent data counting
(generally not used) source port # dest port #
by bytes
sequence number of data
ACK: ACK #
valid acknowledgement number (not segments!)
head not
PSH: push data now len used
UAP R S F receive window
(generally not used) # bytes
checksum Urg data pointer
rcvr willing
RST, SYN, FIN: to accept
options (variable length)
connection estab
(setup, teardown
commands)
application
Internet data
checksum (variable length)
(as in UDP)

Transport Layer 3-17


TCP seq. numbers, ACKs
outgoing segment from sender
sequence numbers: source port # dest port #
sequence number
byte stream “number” of acknowledgement number

first byte in segment’s rwnd

data
checksum urg pointer

window size
acknowledgements: N

seq # of next byte


expected from other side sender sequence number space
cumulative ACK
sent sent, not- usable not
Q: how receiver handles ACKed yet ACKed but not usable
out-of-order segments (“in-
flight”)
yet sent

A: TCP spec doesn’t say, incoming segment to sender


- up to implementor source port # dest port #
sequence number
acknowledgement number
A rwnd
checksum urg pointer

Transport Layer 3-18

You might also like