Module-4-TransportLayer
Module-4-TransportLayer
3
3. It provides a common interface to application
writers, regardless of the underlying network
layer. In essence, an application writer can write
code once using the transport layer primitive and
use it on different networks (but with the same
transport layer).
TL are also have two type of network service,
connection-oriented and connection less.
On both cases it have three phases establishment
data transfer and release.
Addressing and flow control are also similar in
both layers.
It is difficult to provide a connection less
transport service on the top of connection
oriented network layer.
Why are there two distinct layer?
a) The TL code runs entirely on the users
machines but the network layer mostly runs
on the routers which are operated by the
carrier.
b) What happen if it frequently loses packets?
Crash? Inadequate service?
c) The users have no real control over the
network layer so they can not solve the
problem of poor service by using better
routers or putting more error handling in the
data link layer because they do not own the
a) The only possibility is to put on the top of the
network layer another layer that improves the
quality of the service.
b) In connection less network packet are lost. The
transport entity can detect the problem and
compensate for it by using retransmission.
c) In connection oriented network it can set up new
connection , it peer asking which data arrived and
which did not later it can pick up from where it left
off.
d) The existence of the TL makes it possible for the T
service to be more reliable than the underlying
network
a) Application programmers can write code according
to a standard set of primitives .
b) It can work on wide variety of networks.
c) In real world TL isolating the upper layers from the
technology design and imperfections of the
network.
d) The bottom layer are called transport service
provider and upper layers are the transport service
user .
e) TL is in a key position. It is the boundary between
provider and user.
The purpose of TL to provide a reliable
service on top of an un reliable network
a) Main difference
b) 1. the network service is intended to model the
service offered by real networks. Generally un
reliable.
c) 2. whom the service are intended for? many users
or programmers ever see bare network service.
Many see the TL primitives. TL service must be
convenient and easy to use. (NL is not visible for
users but TL)
Elements of Transport Protocols
a) Addressing
b) Connection Establishment
c) Connection Release
d) Flow Control and Buffering
e) Multiplexing
f) Crash Recovery
Addressing
a) When an application process wishes to set up a
connection to a remote application process it must
specify which one to connect to
b) In the Internet endpoints are called ports.
c) Specific endpoint in the transport layer is TSAP
Transport Service Access Point.
d) End point in network is NSAP Network Service
Access Point
e) IP addresses are examples.
Addressing
6-14, a, b
6-14, c,d
(c) Response lost. (d) Response lost and subsequent DRs lost.
User Datagram Protocol (UDP)
a) The User Datagram Protocol (UDP) is one of
the core members of the Internet Protocol
suite, the set of network protocols used for the
Internet.
b) With UDP, computer applications can send
messages, in this case referred to as datagram,
to other hosts on an Internet Protocol (IP)
network without requiring prior
communications to set up special transmission
channels or data paths.
c) UDP uses a simple transmission model with a
minimum of protocol mechanism.
a) It has no handshaking dialogues, and thus
exposes any unreliability of the underlying
network protocol to the user's program.
b) This is normally IP over unreliable media,
there is no guarantee of delivery, ordering or
duplicate protection.
c) UDP provides checksums for data integrity,
and port numbers for addressing different
functions at the source and destination of the
datagram.
a) UDP is suitable for purposes where error
checking and correction is either not
necessary or performed in the application,
avoiding the overhead of such processing at
the network interface level.
b) Time-sensitive applications often use UDP
because dropping packets is preferable to
waiting for delayed packets, which may not be
an option in a real-time system.
a) Many of the Internet applications use UDP,
including: the Domain Name System, where
queries must be fast and only consist of a
single request followed by a single reply
packet, the Simple Network Management
Protocol (SNMP), the Routing Information
Protocol (RIP) and the Dynamic Host
Configuration Protocol (DHCP).
a) Voice and video traffic is generally transmitted
using UDP. Real-time video and audio streaming
protocols are designed to handle occasional lost
packets, so only slight degradation in quality
occurs, rather than large delays if lost packets were
retransmitted.
b) Because both TCP and UDP run over the same
network, many businesses are finding that a recent
increase in UDP traffic from these real-time
applications is hindering the performance of
applications using TCP, such as point of sale,
accounting, and database systems.
Transmission Control Protocol (TCP
a) The Transmission Control Protocol (TCP) is one of
the core protocols of the Internet Protocol Suite
b) TCP provides reliable, ordered delivery of a stream
of bytes from a program on one computer to
another program on another computer.
c) TCP is the protocol used by major Internet
applications such as the World Wide Web, email,
remote administration and file transfer. TCP
provides a communication service at an
intermediate level between an application program
and the Internet Protocol (IP).
a) That is, when an application program desires
to send a large chunk of data across the
Internet using IP, instead of breaking the data
into IP-sized pieces and issuing a series of IP
requests, the software can issue a single
request to TCP and let TCP handle the IP
details.
a) IP works by exchanging pieces of information
called packets.
b) A packet consists of a header followed by a
body.
c) The header describes the packet's destination
and, optionally, the routers to use for
forwarding until it arrives at its destination.
The body contains the data IP is transmitting.
a) Due to network congestion, traffic load balancing,
or other unpredictable network behavior, IP packets
can be lost, duplicated, or delivered out of order.
b) TCP detects these problems, requests
retransmission of lost data, rearranges out-of-order
data, and even helps minimize network congestion
to reduce the occurrence of the other problems.
c) Once the TCP receiver has reassembled the
sequence of octets originally transmitted, it passes
them to the application program. Thus, TCP
abstracts the application's communication from the
underlying networking details.
a) TCP is used for applications such as the
World Wide Web (WWW), E-mail, File
Transfer Protocol, Secure Shell, peer-to-peer
file sharing, and some streaming media
applications.
a) TCP is optimized for accurate delivery rather
than timely delivery, and therefore, TCP
sometimes incurs relatively long delays (some
seconds) while waiting for out-of-order
messages or retransmissions of lost messages.
b) It is not suitable for real-time applications
such as Voice over IP. For such applications,
protocols like the Real-time Transport
Protocol (RTP) running over the User
Datagram Protocol (UDP) are usually used.
a) TCP is a reliable stream delivery service that
guarantees that all bytes received will be identical
with bytes sent and in the correct order.
b) Since packet transfer is not reliable, a technique
known as positive acknowledgment with
retransmission is used to guarantee reliability of
packet transfers.
c) This fundamental technique requires the receiver to
respond with an acknowledgment message as it
receives the data. The sender keeps a record of each
packet it sends.
a) The sender also keeps a timer from when the packet
was sent, and retransmits a packet if the timer
expires before the message has been acknowledged.
The timer is needed in case a packet gets lost or
corrupted.
a) The sender also keeps a timer from when the
packet was sent, and retransmits a packet if
the timer expires before the message has been
acknowledged. The timer is needed in case a
packet gets lost or corrupted.
b) A TCP segment consists of a segment header
and a data section. The TCP header contains
10 mandatory fields, and an optional
extension field
a) Source port: 16 Bit number which
identifies the Source Port number
(Sending Computer's TCP Port).
b) Destination port: 16 Bit number which
identifies the Destination Port number
(Receiving Port).
a) Sequence number: 32 Bit number used for byte
level numbering of TCP segments. If you are using
TCP, each byte of data is assigned a sequence
number.
b) If SYN flag is set (during the initial three way
handshake connection initiation), then this is the
initial sequence number. The sequence number of
the actual first data byte will then be this sequence
number plus 1.
c) For example, let the first byte of data by a device in
a particular TCP header will have its sequence
number in this field 50000. If this packet has 500
bytes of data in it, then the next packet sent by this
device will have the sequence number of 50000 +
500 + 1 = 50501.
a) Acknowledgment Number: 32 Bit number
field which indicates the next sequence
number that the sending device is expecting
from the other device. ( Server to client)
b) Header Length: 4 Bit field which shows the
number of 32 Bit words in the header. Also
known as the Data Offset field. The minimum
size header is 5 words (binary pattern is
0101).
c) Reserved: Always set to 0 (Size 6 bits).
a) PSH: This flag means Push function. Using this
flag, TCP allows a sending application to specify
that the data must be pushed immediately. When an
application requests the TCP to push data, the TCP
should send the data that has accumulated without
waiting to fill the segment.
a) RST: Reset the connection. The RST bit is used to
RESET the TCP connection due to unrecoverable
errors.
b) When an RST is received in a TCP segment, the
receiver must respond by immediately terminating
the connection.
c) A RESET causes both sides immediately to release
the connection and all its resources. As a result,
transfer of data ceases in both directions, which
can result in loss of data that is in transit. A TCP
RST indicates an abnormal terminination of the
connection.
a) Control Bit Flags: We have seen before that TCP is
a Connection Oriented Protocol.
b) The meaning of Connection Oriented Protocol is
that, before any data can be transmitted, a reliable
connection must be obtained and acknowledged.
c) Control Bits govern the entire process of
connection establishment, data transmissions and
connection termination. The control bits are listed
as follows: They are:
d) URG: Urgent Pointer.
e) ACK: Acknowledgement.
a) FIN: No more data from the sender. Receiving a
TCP segment with the FIN flag does not mean that
transferring data in the opposite direction is not
possible. Because TCP is a fully duplex connection,
the FIN flag will cause the closing of connection
only in one direction. To close a TCP connection
gracefully, applications use the FIN flag
b) Window: indicates the size of the receive window,
which specifies the number of bytes beyond the
sequence number in the acknowledgment field that
the receiver is currently willing to receive.
a) Checksum: The 16-bit checksum field is used for error-
checking of the header and data.
b) Urgent Pointer: Shows the end of the urgent data so that
interrupted data streams can continue. When the URG bit is
set, the data is given priority over other data streams (Size
16 bits).
Key Features of TCP
a) Some key features of TCP that set TCP apart from
User Datagram Protocol are:
b) • Ordered data transfer — the destination host
rearranges according to sequence number
c) • Retransmission of lost packets — any cumulative
stream not acknowledged is retransmitted
d) • Error-free data transfer
e) • Flow control — limits the rate a sender transfers
data to guarantee reliable delivery. The receiver
continually hints the sender on how much data can
be received.
a) When the receiving host's buffer fills, the next
acknowledgment contains a 0 in the window
size, to stop transfer and allow the data in the
buffer to be processed.
b) • Congestion control
TCP vs UDP
a) Transmission Control Protocol is a
connection-oriented protocol, which means
that it requires handshaking to set up end-to-
end communications. Once a connection is set
up user data may be sent bi-directionally over
the connection.
TCP
a) Reliable – TCP manages message
acknowledgment, retransmission and timeout.
Multiple attempts to deliver the message are
made. If it gets lost along the way, the server
will re-request the lost part. In TCP, there's
either no missing data, or, in case of multiple
timeouts, the connection is dropped.
a) Ordered – if two messages are sent over a
connection in sequence, the first message will reach
the receiving application first. When data segments
arrive in the wrong order, TCP buffers the out-of-
order data until all data can be properly re-ordered
and delivered to the application.
a) • Heavyweight – TCP requires three packets
to set up a socket connection, before any user
data can be sent. TCP handles reliability and
congestion control.
b) • Streaming – Data is read as a byte stream, no
distinguishing indications are transmitted to
signal message (segment) boundaries.
UDP
a) UDP is a simpler message-based connectionless
protocol. Connectionless protocols do not set up a
dedicated end-to-end connection.
b) Communication is achieved by transmitting
information in one direction from source to
destination without verifying the readiness or state
of the receiver.
c) However, one primary benefit of UDP over TCP is
the application to voice over internet protocol
(VoIP) where any handshaking would hinder clear
voice communication.
d) It is assumed in VoIP UDP that the end users
provide any necessary real time confirmation that
a) Unreliable – When a message is sent, it
cannot be known if it will reach its
destination; it could get lost along the way.
There is no concept of acknowledgment,
retransmission, or timeout.
b) Not ordered – If two messages are sent to the
same recipient, the order in which they arrive
cannot be predicted.
c) Lightweight – There is no ordering of
messages, no tracking connections, etc. It is a
small transport layer designed on top of IP.
a) Datagram – Packets are sent individually and
are checked for integrity only if they arrive.
Packets have definite boundaries which are
honored upon receipt, meaning a read
operation at the receiver socket will yield an
entire message as it was originally sent.
b) No congestion control – UDP itself does not
avoid congestion, and it's possible for high
bandwidth applications to trigger congestion
collapse, unless they implement congestion
control measures at the application level.
TCP Service Model (3)
All TCP connections are full-duplex and point-to-point.