Chapter 3.
Protocols
Confidential
CHAPTER OBJECTIVES
At the end of this Chapter you will be able to:
Identify transport layer protocols
Identify Internet layer protocols
Differentiate between OSI and TCP/IP network model
Confidential
OSI vs. TCP/IP Model
Confidential
Transport Layer Protocols (TCP & UDP)
Introducing Transport Layer Protocol
The major functions of Transport Layer are:
It sets up and maintains a connection between two
devices.
It can provide for the reliable or unreliable delivery of data
across the connection.
It can implement flow control through ready/not ready signals
or Windowing to ensure that the sender do not overwhelm the
receiver with too many segments.
It multiplexes the connections, allowing multiple applications
to simultaneously send and receive data through port or
socket numbers
Confidential
The Most common Transport Layer Protocols are:
T.C.P (Transmission Control Protocol)
U.D.P (User Datagram Protocol)
Transmission Control Protocol
TCP is a Reliable (guarantees that the data sent across the
connection will be delivered exactly as sent, without missing
or duplicate data), Connection oriented (An application
requests a connection, and then uses it for data transfer)
protocol on the transport layer which provides in-order
delivery of data and also use buffering and windowing to
implement flow control.
Confidential
TCP/IP Segment
Confidential
Conti…
The following are the description of each field of TCP segment:
The SOURCE PORT field identifies the TCP process which sent
the datagram.
The DESTINATION PORT field identifies the TCP process that
will handle the payload.
The SEQUENCE NUMBER field identifies the first octet of the
outgoing data. The receiver uses this to re-order segments
arriving out of order and to compute an acknowledgement
number. (for Reliability)
The ACKNOWLEDGEMENT NUMBER field identifies the
sequence number of the incoming data that is expected next.
(for Reliability)
The HLEN field is the header length (including possible
options) in 32-bit words.
Confidential
Conti…
The CODE BITS (or FLAGS) field contains one or more 1-bit
flags (see next page).
The WINDOW field identifies how much buffer space is
available for incoming data. (for Flow control) or the
number of segments that can be sent before receiving any
acknowledgement.
The CHECKSUM field contains a simple checksum over the
TCP segment header.
The URGENT POINTER field contains an offset into the TCP
data stream marking the end octet of some urgent data
Confidential
Conti…
TCP Code Bits:-
The URG flag indicates that the URGENT POINTER field is valid.
The ACK flag indicates that the ACKNOWLEDGEMENT
NUMBER
is valid.
The PSH flag indicates pushed data, i.e. data that should be
delivered immediately and not buffered.
The RST flag is used to reset a connection, i.e. a confused or
refused connection.
The SYN flag is used to establish a connection.
The FIN flag is used to terminate a connection.
Confidential
TCP Connection Establishment
Since TCP is a connection oriented protocol, for two hosts to
communicate using TCP they must first establish a connection by
exchanging messages in what is known as the three-way handshake. The
diagram below depicts the process of the three-way handshake.
Connection Establishment ( 3 Way Handshake)
Confidential
User Datagram Protocol
The UDP is an unreliable connectionless protocol of the transport
layer.
UDP is unreliable, means that UDP does not provide mechanisms
for error detection and error correction between the source and
the destination. Because of this, UDP utilized bandwidth more
efficiently than TCP.
Confidential
Source Port (16 bits): The port number of the sender.
Destination Port (16 bits): The port this packet is addressed to.
Length (16 bits): The length in bytes of the UDP
header and the encapsulated data.
The minimum value for this field is 8.
Checksum (16 bits): Contains a checksum over the UDP
segment header.
Data (Variable length): he length of data is variable.
UDP is connectionless, unreliable protocol of Transport layer but is still
used because:
UDP utilizes bandwidth more efficiently than TCP as it does not
take the overhead of establishing connection before transmitting
the data.
UDP is very efficient for protocols that send very small amounts of
data at irregular intervals.
UDP is very efficient when the data is to be broadcasted in the
whole network.
Confidential
Internet Layer Protocols (IP, ICMP, ARP, RARP)
1. Internet Protocol
Its functions include:
Defining the datagram, which is the basic unit of transmission
in the Internet
Defining the Internet addressing scheme
Moving data between the Network Access Layer and the Host-
to-Host Transport Layer
Routing datagrams to remote hosts
Performing fragmentation and re-assembly of datagrams
Confidential
IP Datagram
The TCP/IP protocols were built to transmit data over a packet
switching network. A packet is a block of data that carries with it
the information necessary to deliver it - in a manner similar to a
postal letter, which has an address written on its envelope
Confidential
Conti…
The following are the description of each field of IP datagram:
VERS is the IP protocol version (IPv4 or IPv6). This allows
different
versions of IP to co-exist on a host.
HLEN is the header length in 32-bit words. This is required
because options may be present in the header.
SERVICE TYPE (left to right)
3-bit PRECEDENCE is generally ignored today.
When set, the D bit requests minimal delay.
When set, the T bit requests maximum throughput.
When set, the R bit requests maximum reliability.
When set, the M bit requests minimal cost.
Unused, 1-bit.
Confidential
Conti…
TOTAL LENGTH is header and data in octets (bytes). This is
required because some data-link layer protocols (e.g. Ethernet)
pad small frames to a minimum length.
IDENTIFICATION is a number uniquely identifying each datagram
sent by a host.
FLAGS (left to right).
Unused, 1-bit.
DON'T FRAGMENT flag
MORE FRAGMENTS flag
FRAGMENT OFFSET measured in eight-byte units (basically used
to assemble fragments at the destination.)
Confidential
Conti…
TIME TO LIVE (TTL) specifies how many routers may process this
datagram before it is discarded. It is initialised by the sender and
decremented by one by each router that handles the datagram.
When the field reaches zero, the datagram is discarded and the
sender notified with an ICMP message.
TYPE identifies which upper-level protocol provided the data for IP
to send (e.g. ICMP, TCP or UDP).
HEADER CHECKSUM, as the name implies, is calculated over the
header only. It is computed by first setting the checksum field to
zero, then taking the 16-bit one's complement sum of the header
(taken as a sequence of 16-bit words), and then taking the 16-bit
one's complement of this sum. Any receiver will also compute the
6-bit one's complement sum of the header. If the checksum is not
zero, the datagram is discarded.
SOURCE IP ADDRESS identifies the original sender of the datagram.
DESTINATION IP ADDRESS identifies the final recipient of the
datagram.
Confidential
2. Address Resolution Protocol (ARP)
The address resolution protocol is a protocol used by the Internet
Protocol(IP), specifically IPv4, to map IP network addresses to the
hardware addresses used by a data link protocol
Confidential
3. Reverse Address Resolution Protocol (RARP)
Reverse Address Resolution Protocol, a TCP/IP Protocol that
permits a Physical Address, such as an Ethernet address, to be
translated into an IP address.
ICMP functions at the network layer of Internet Protocol
The protocol reports errors related to the delivery of IP packets
within a network
ICMPs generate the following four messages
Destination Unreachable message
Echo request message
Redirect message
Time exceeded message
Confidential
Comparison of OSI and TCP/IP Models
Similarities:
The main similarities between the two models include the
following:
They share similar architecture. - Both of the models share a
similar architecture. This can be illustrated by the fact that both
of them are constructed with layers.
They share a common application layer.- Both of the models
share a common "application layer". However in practice this
layer includes different services depending upon each model.
Both models have comparable transport and network layers.-
his can be illustrated by the fact that whatever functions are
performed between the presentation and network layer of the
OSI model similar functions are performed at the Transport layer
of the TCP/IP model.
Both models assume that packets are switched.- Basically this
means that individual packets may take differing paths in order
to reach the same destination.
Confidential
Differences:
The main differences between the two models are as follows:
TCP/IP Protocols are considered to be standards around
which the internet has developed. The OSI model however is
a “generic, Protocol-Independent Standard.
TCP/IP combines the presentation and Chapter layer issues
into its application layer.
TCP/IP combines the OSI data link and physical layers into
the
network access layer.
TCP/IP appears to be a simpler model and this is mainly due
to the fact that it has fewer layers.
TCP/IP is considered to be a more credible model- This is
mainly due to the fact because TCP/IP protocols are the
standards around which the internet was developed therefore
it mainly gains creditability due to this reason. Where as in
contrast networks are not usually built around the OSI model
as it is merely used as a Confidential
guidance tool.
THANK YOU
Confidential