Protocols
Protocols
Protocols
Protocols
Confidential
CHAPTER OBJECTIVES
Confidential
OSI vs. TCP/IP Model
Confidential
Transport Layer Protocols (TCP & UDP)
Confidential
The Most common Transport Layer Protocols are:
T.C.P (Transmission Control Protocol)
U.D.P (User Datagram Protocol)
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…
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.
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.
Confidential
Internet Layer Protocols (IP, ICMP, ARP, RARP)
1. Internet Protocol
Its functions include:
Confidential
IP Datagram
Confidential
Conti…
The following are the description of each field of IP datagram:
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.
sent by a host.
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)
Confidential
3. Reverse Address Resolution Protocol (RARP)
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
Confidential