You are on page 1of 30

Layer 4 – Transport Layer

• Purpose of the transport layer


– to transport and regulate the flow of
information from source to destination,
reliably and accurately
– end-to-end control, provided by sliding
windows, and reliability in sequencing
numbers and acknowledgments
Layer 4 – Transport Layer
• Layer 4 protocols – TCP and UDP
– TCP supplies a virtual circuit between end-user
applications. These are its characteristics:
• connection-oriented
• reliable
• divides outgoing messages into segments
• reassembles messages at the destination station
• re-sends anything not received
• reassembles messages from incoming segments
Layer 4 – Transport Layer
• Layer 4 protocols – TCP and UDP
– UDP transports data unreliably between hosts.
Following are the characteristics of UDP:
• connectionless
• unreliable
• transmit messages (called user datagrams)
• provides no software checking for message delivery
(unreliable)
• does not reassemble incoming messages
• uses no acknowledgments
• provides no flow control
Layer 4 – Transport Layer
• TCP/IP is a combination of two
individual protocols - TCP and IP
– IP is a Layer 3 protocol - a connectionless
service that provides best-effort delivery
across a network
– TCP is a Layer 4 protocol - a connection-
oriented service that provides flow control
as well as reliability
Layer 4 – Transport Layer
• Transmission Control Protocol (TCP)
– is a connection-oriented Layer 4 (transport
layer) protocol that provides reliable full-
duplex data transmission
Layer 4 – Transport Layer
• Following are the definitions of the fields in
the TCP segment:
– source port -- number of the calling port
– destination port -- number of the called port
– sequence number -- number used to ensure
correct sequencing of the arriving data
– acknowledgment number - next expected TCP
octet
– HLEN -- number of 32-bit words in the header
Layer 4 – Transport Layer
– reserved -- set to zero
– code bits -- control functions (such as setup and
termination of a session)
– window -- number of octets that the sender is
willing to accept
– checksum -- calculated checksum of the header
and data fields
– urgent pointer -- indicates the end of the urgent
data
– option-one option -- maximum TCP segment size
– data -- upper-layer protocol data
Layer 4 – Transport Layer
• User Datagram Protocol (UDP)
– the connectionless transport protocol in the
TCP/IP protocol stack
– UDP uses no windowing or acknowledgments,
therefore application layer protocols provide
reliability
– UDP is designed for applications that do not need
to put sequences of segments together
– Protocols that use UDP include:
• TFTP (Trivial File Transfer Protocol)
• SNMP (Simple Network Management Protocol)
• DHCP (Dynamic Host Control Protocol) 
• DNS (Domain Name System)
Layer 4 – Transport Layer
• Port numbers
– Both TCP and UDP use port (or socket)
numbers to pass information to the upper
layers
– Port numbers are used to keep track of
different conversations that cross the
network at the same time
– Well-known port numbers are defined in
RFC1700
Layer 4 – Transport Layer
• Port numbers have the following
assigned ranges:
– Numbers below 255 - for public
applications
– Numbers from 255-1023 - assigned to
companies for marketable applications
– Numbers above 1023 - are unregulated
• See 12.3.1 for common port numbers
Layer 4 – Transport Layer
• Connection oriented services involve three
phases
– connection establishment phase - a single path
between the source and destination is
determined
– data transfer phase - data is transmitted
sequentially over the established path, arriving at
the destination in the order in which it was sent
– connection termination phase - terminating the
connection between the source and destination
when it is no longer needed
Layer 4 – Transport Layer
• TCP hosts establish a connection-
oriented session with one another
using a three-way handshake
– synchronizes a connection at both ends
before data is transferred
– exchange of introductory sequence
numbers
– ensures that any data that is lost, due to
transmission problems, can be recovered
Layer 4 – Transport Layer
Layer 4 – Transport Layer
• Positive acknowledgment and retransmission,
or PAR, is a common technique many protocols
use to provide reliability.
• The source sends a packet, starts a timer, and
waits for an acknowledgment before sending
the next packet.
• If the timer expires before the source receives
an acknowledgment, the source retransmits the
packet and starts the timer over again
Layer 4 – Transport Layer
• Window size
– determines the amount of data that you can
transmit at one time before receiving an
acknowledgment from the destination
– The larger the window size number (bytes), the
greater the amount of data that the host can
transmit
– After a host transmits the window-sized number
of bytes, the host must receive an
acknowledgment that the data has been received
before it can send any more messages
Layer 4 – Transport Layer
• TCP uses expectational acknowledgments
– meaning that the acknowledgment number refers
to the octet that is next expected
– The "sliding" part, of sliding window, refers to the
fact that the window size is negotiated
dynamically during the TCP session. This results
in inefficient use of bandwidth by the hosts
Layer 4 – Transport Layer
• TCP provides sequencing of segments with a
forward reference acknowledgment
• Each datagram is numbered before
transmission
• At the receiving station, TCP reassembles the
segments into a complete message
• If a sequence number is missing in the series,
that segment is re-transmitted.
• Segments that are not acknowledged within a
given time period result in re-transmission
Layer 5 – Session Layer
• Session layer - establishes, manages,
and terminates sessions between
applications
• This includes starting, stopping, and re-
synchronizing
• dialogue control - Determining which
role each host plays requesting service
or replying service
Layer 5 – Session Layer
• dialogue control - session layer decides
whether to use two-way simultaneous
conversation or two-way alternate
communication
– If two-way simultaneous communication is
allowed, then the session layer does little in the
way of managing the conversation other layers
handle conversation
– Possible to have session layer collisions
messages pass each other, and cause confusion
in either, or both, communicating hosts
Layer 5 – Session Layer
• dialogue control - session layer
decides whether to use two-way
simultaneous conversation or two-way
alternate communication
– Two-way alternate communication
involves the use of a session layer data
token that allows each host to take turns
Layer 5 – Session Layer
• Dialogue separation is the orderly initiation,
termination, and managing of
communication
• minor synchronization - the host A session
layer sends a synchronization message to
host B
• checkpoints are used to separate parts of a
session previously referred to as dialogues
Layer 5 – Session Layer
• Layer 5 has a number of important protocols.
– Network File System (NFS)
– Structured Query Language (SQL)
– Remote Procedure Call (RPC)
– X-Window System
– AppleTalk Session Protocol (ASP)
– Digital Network Architecture Session Control
Protocol (DNA SCP)
Layer 5 – Session Layer
• The session layer establishes, manages, and terminates
sessions between applications
• Communication sessions consist of mini-conversations
that occur between applications located in different
network devices
• Requests and responses are coordinated by protocols
implemented at the session layer
• The session layer decides whether to use two-way
simultaneous communication or two-way alternate
communication by using dialogue control
• The session layer uses dialogue separation to orderly
initiate, terminate, and manage communication
Layer 6 – Presentation Layer
• Presentation layer is concerned with the
format and representation of data
• this layer can translate between different
data formats
• provides code formatting and conversion,
which is used to make sure that applications
have meaningful information to process
• concerned with the data structures that are
used by applications
Layer 6 – Presentation Layer
• Layer 6, the presentation layer,
provides three main functions. These
functions are:
– data formatting (presentation)
– data encryption
– data compression
Layer 6 – Presentation Layer
• Layer 6 standards also determine how
graphic images are presented. Three of
these standards are as follows:
– PICT - a picture format used to transfer
QuickDraw graphics between programs on the
MAC operating system
– TIFF (Tagged Image File Format) - a format for
high-resolution, bit-mapped images
– JPEG (Joint Photographic Experts Group) -
graphic format used most often to compress still
images of complex pictures and photographs
Layer 6 – Presentation Layer
• Other Layer 6 standards guide the
presentation of sound and movies. Included
in these standards are the following:
– MIDI (Musical Instrument Digital Interface) - for
digitized music
– MPEG (Motion Picture Experts Group) - standard
for the compression and coding of motion video
for CDs and digital storage
– QuickTime - a standard that handles audio and
video for programs on both MAC and PC
operating system
Layer 6 – Presentation Layer
• ASCII and EBCDIC are used to format text
– ASCII text files contain simple character data, and
lack any sophisticated formatting commands,
such as boldface or underline. Used on PCs
– EBCDIC is very similar to ASCII in that it also
does not use any sophisticated formatting. Use on
mainframes.
• Binary files contain special coded data that
can only be read by specific software
applications
Layer 6 – Presentation Layer
• Data encryption and compression
– Data encryption protects information
during its transmission
– Compression works by using algorithms
(complex mathematical formulas) to shrink
the size of the files
Layer 6 – Presentation Layer
• the presentation layer is needed to convert
and translate between the two different
formats. In addition, you learned that the
presentation layer:
– determines how graphic images, sound and
movies are presented 
– provides encryption of data
– compresses text and converts graphic images
into bit streams so they can be transmitted
across a network

You might also like