Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 15

The Transport Layer

Transport Layer
Goals: Overview:
• understand • transport layer services
principles behind • connectionless transport:
transport layer UDP
services and • connection-oriented
protocols: transport: TCP
– UDP
– reliable transfer
– TCP
– flow control
– connection management
Transport services and protocols
• provide logical communication between app’
processes running on different hosts
• transport protocols run in end systems

transport vs network layer services:


• network layer: data transfer between end
systems
• transport layer: data transfer between processes
– relies on, enhances, network layer services
Transport-layer protocols
Internet transport services:
• reliable, in-order unicast delivery (TCP)
– congestion
– flow control
– connection setup
• unreliable (“best-effort”), unordered unicast or
multicast delivery: UDP
• services not available:
– real-time
– bandwidth guarantees
– reliable multicast
Elements of Transport Protocols
1. Addressing
2. Connection Establishment
3. Connection Release
4. Flow Control and Buffering
5. Multiplexing
6. Crash Recovery
UDP: User Datagram Protocol [RFC
768]
• “no frills”, “bare bones” Internet
transport protocol
• “best effort” service, UDP segments
may be:
Why is there a
– lost UDP?
– delivered out of order to app • no connection establishment
• connectionless: (which can add delay, less
– no handshaking between UDP resource required)
sender & receiver • simple: no connection state
– each UDP segment handled at sender, receiver
independently of others • small segment header
• no congestion control: UDP
can blast away as fast as
desired
UDP (cont’d)
• often used for streaming
multimedia apps
32 bits
– loss tolerant
– rate sensitive Length in source port # dest port #
• other UDP uses bytes of UDP length checksum
– DNS segment,
including
– SNMP
header
• reliable transfer over UDP: add
reliability at application layer
– application-specific error
Application
recovery! data
(message)

UDP segment format


TCP: Overview
• point-to-point: • full duplex data:
– one sender, one receiver – bi-directional data flow in same
• reliable, in-order byte steam: connection
– no “message boundaries” – MSS: maximum segment size
• pipelined: • connection-oriented:
– TCP congestion and flow – handshaking (exchange of
control set window size control msgs) init’s sender,
receiver state before data
exchange
• flow controlled:
– sender will not overwhelm
receiver
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
UA P R S F rcvr window size
(generally not used) # bytes
checksum ptr urgent data
rcvr willing
RST, SYN, FIN: to accept
Options (variable length)
connection estab
(setup, teardown
commands)
application
Internet data
checksum (variable length)
(as in UDP)
Connection Establishment

Three protocol scenarios for establishing a connection using a


three-way handshake. CR denotes CONNECTION REQUEST.
(a) Normal operation,
(b) Old CONNECTION REQUEST appearing out of nowhere.
(c) Duplicate CONNECTION REQUEST and duplicate ACK.
Some TCP features
Every byte has its own 32 bit sequence number.

Sending and receiving entities exchange data in segments

Each segment is the 20 byte header and data (total up to 64K)

TCP may aggregate multiple writes into one segment or split one
write into several segments.

A segment size if the smaller of either 64K or the MTU of the


network layer (MTU of Ethernet is about 1500 bytes)

A segment must fit in a single IP payload.


Some TCP features
TCP uses the sliding window protocol as its base.

Sender sends segment, starts timer waits for ack. It no ack then
retransmit. Receiver acks in separate segment or “piggyback” on
data segment.

TCP must deal with reordred segments.

A lot of algorithms have been developed to make TCP efficient


under diverse network conditions. We will look at a few of them.
TCP and UDP
• Transmission Control Protocol (TCP) – is
a connection-oriented transport layer
TCP/IP protocol that provides reliable data
transmission.
• User Datagram Protocol (UDP) – is a
connectionless transport layer protocol in
the TCP/IP protocol stack. UDP is a
simple protocol that exchanges datagrams
without acknowledgements or guaranteed
delivery.
• TCP and UDP are Transport Layer or
Layer 4 protocols.
TCP and UDP
• Transmission Control Protocol (TCP) – is
a connection-oriented transport layer
TCP/IP protocol that provides reliable data
transmission.
• User Datagram Protocol (UDP) – is a
connectionless transport layer protocol in
the TCP/IP protocol stack. UDP is a
simple protocol that exchanges datagrams
without acknowledgements or guaranteed
delivery.
• TCP and UDP are Transport Layer or
Layer 4 protocols.
TCP and UDP Comparison

Function Description (TCP) Description


(UDP)
Ordered data This involves a continuous stream Does not
transfer of ordered data. reorder received
data.
Multiplexing Receiving hosts decide the correct Same as TCP.
using ports application for which the data is
destined, based on the port
number.
Reliable Acknowledgment of data uses the This is not a
transfer Sequence and Acknowledgment feature of UDP.
fields in the TCP header.
Flow control This process is used to protect This is not a
buffer space and routing devices. feature of UDP.
Connections This process is used to initialize UDP is
port numbers and other TCP connectionless.
header fields.

You might also like