You are on page 1of 40

TCP/IP PROTOCOL SUITE

An Overview:
•TCP/IP was developed by the Department of Defense prior to
the introduction of the 7 layer OSI model. It is the de facto global
standard for the Internet. The Internet (earlier known as
ARPANet) was a part of a military project of the of Advanced
Research Projects Agency (ARPA) and the communication model
based thereon is known as ARPA model.
•ARPA was developed in USA before the OSI model was
developed in Europe by ISO.
•Whereas the OSI model specifies exactly what function(s) each
layer has to perform, TCP/IP comprises several relatively
independent protocols that can be combined in several ways.
•Although TCP/IP and OSI were developed at different times by
different bodies, they form the basis for data communications
having different types and of different complexities.
•It is not mandatory to use all the layers in the TCP/IP model, for
example, some application level protocols operate directly on top
of IP. TCP/IP does not include the bottom network interface layer,
but it depends on the same for access to the medium.
OSI vs TCP/IP
OSI being the reference model, all network models are compared with the
seven layers of OSI model for their functionality.
The TCP/IP model uses 5 layers to perform the functions of the 7-layer OSI
model.
• The network access layer is functionally equal to a combination of OSI
physical and data link layers (1 and 2).
• The Internet layer performs the same functions as the OSI network layer
(3).
Things get a bit more complicated at the host-to-host layer of the TCP/IP
model. If the host-to-host protocol is TCP, the matching functionality is
found in the OSI transport and session layers (4 and 5). Using UDP equates
to the functions of only the transport layer of the OSI model.
• The TCP/IP process layer, when used with TCP, provides the functions of
the OSI model’s presentation and application layers (6 and 7).
• When the TCP/IP transport layer protocol is UDP, the process layer’s
functions are equivalent to OSI session, presentation, and application
layers (5, 6, and 7).
OSI vs TCP/IP:COMPARISON
OSI TCP/IP

APPLICATION

PRESENTATION APPLICATION USER


SPACE
SESSION SW
TRANSPORT TRANSPORT
(HOST TO HOST)
NETWORK INTERNET OPERATING
FW SYSTEM
NETWORK ACCESS
DATA LINK HW
PHYSICAL PHYSICAL
PROTOCOL ARCHITECTURE
The five layer TCP/IP Reference Model
LAYER NO. LAYER NAME PURPOSE
L-5 APPLICATION Specifies communication methodology between
LAYER diff. processes/applications residing on different
hosts
L-4 TRANSPORT Provides end-to-end reliable data transfer
LAYER OR
HOST TO HOST
L-3 INTERNET Routes data between host and destination nodes
LAYER through one or more networks connected by
routers
L-2 NETWORK Concerned with logical interface between an end
ACCESS LAYER system and a network
L-1 PHYSICAL Concerned with physical transmission medium,
LAYER signal encoding scheme, signal transm’n rate etc.
PROTOCOL ARCHITECHTURE (CONTD..)

• The application layer corresponds to the upper


three layers of the OSI model, i.e., Application,
Presentation and Session layers.
• TCP residing in the Transport layer ensures data
delivery to the proper process.
• The Internet Layer routes data from the host to
the destination node via one or more networks,
with the help of the IP addresses.
• The Network Access layer interfaces an end
system with the network while the lowest or
Physical layer is concerned with signal rate, signal
encoding etc.
Protocols available at Different Layers In the TCP/IP
Protocol Suite.
Different Protocols of TCP/IP
• At the different layers, different protocols are
available.
• Amongst them, TCP and UDP belonging to the
Transport layer and IP in the Network layer are
the ones which form the basis for data
delivery from one computer stationed at one
end of the globe to another computer housed
at the other end.
Various TCP/IP Protocols etc.
DNS Domain name System
BGP Border Gateway Protocol
FTP File Transfer Protocol
HTTP Hyper Text Transfer Protocol
ICMP Internet Control Message Protocol
IGMP Internet Group Management Protocol
TELNET :Remote Login To Network
IP Internet Protocol
MIME Multipurpose Internet Mail Extension
OSPF Open Short Path First
RSVP Resource Reservation Protocol
SMTP Simple Mail Transfer Protocol
SNMP Simple Network Management Protocol
TCP Transmission Control Protocol
UDP User Datagram Protocol
ARP Address Resolution Protocol
ARPANET :Advance Research Project Agency Network
TCP
Transmission Control Protocol (TCP) is a connection
oriented Transport layer protocol.
Functionalities include-
• Reliable Data Delivery,
• Congestion Control,
• Duplicate Data Suppression,
• Flow Control etc.
• Most of the user application protocols like FTP
and Telnet use TCP.
Two processes can communicate with each other through
the TCP connection with the help of IP datagrams (figure)
To establish a session: TCP establishes a session between the
transmitting process and the receiving process before initiating
transmission. There are facilities to check that all packets have
been received and arrange for retransmission, in case of packet
loss. These involve additional overhead and leads to higher
processing time and header size but at the same time makes the
system more reliable.

• To fragment a large chunk of data: TCP fragments a large


chunk of data into smaller segments when necessary,
numbers the segments, reassemble the whole message,
detects and arrange for retransmission in case of failure,
issues acknowledgements for data received, provides socket
services for multiple connections to ports on remote hosts.
The segmented messages may be received out of order at the
receiver, which the TCP reassembles in correct order.
The TCP Header Format:
Each and every TCP segment has a header which comprises all the necessary
information for proper data delivery and retrieval.
The TCP header format is shown in figure
• The sending and destination ports are each 16 bits. While
the former identifies the sending end host, the latter the
receiving host. A destination host is identified by its IP
number and the process on the host is identified by its port
number. The IP number in conjunction with port number is
called socket.

• The sequence number, consisting of 32-bits, ensures the


sequentiality of data stream that is sent by the sending end
host. It specifies the first byte of the user data in the
segment. During the initial set-up, it represents the Initial
Sequence Number (ISN) that identifies the first byte of data
in every segment of data sent by TCP. For a particular
connection. ISN ensures that data is reassembled in correct
order at the receiving host.
• Acknowledgment number is 32-bit in length and is ‘sequence number + 1’
of the last successfully received data byte. The sending host, while
transmitting, sets a timer and if the acknowledgements are not received
within the specified time, an error is assumed and the data is again
retransmitted.
• Data offset is 4-bits in length and indicates where the data begins. The six
flags, each of 1-bit, control connection and data transfer. These are:-
URG: indicates that the header contains the valid urgent pointer
ACK: indicates that the header contains a valid acknowledgement number
PSH: It is push function forcing TCP to promptly deliver data
RST: Exercising this causes the connection to be resetted
SYN: It exerts that sequence numbers are synchronized and handshaking
operations occur
FIN: Indicates that no more data is there from the sender

• Window size is 16 bits and provides flow control. The checksum field is
used for error control, while the urgent pointer field, in association with
URG flag, can insert a block of ‘urgent’ data at the beginning of a segment.
TCP WINDOW PRINCIPLE:

In TCP, sequence number is assigned to each byte in the


data stream, giving rise to a segment and they are sent
one after the other. The window principle is applied at
the byte level in case of TCP, the segments sent and the
ACKs received. The window size is expressed in terms
of number of bytes instead of number of packets.

The receiver determines the window size and it is a


variable one during data transfer. An ACK sent by the
receiver is representative of the window size the
receiver is capable of handling at that instant of time.
A sender’s data stream at any given instant can look like as
shown in figure
In the figure,
A represents :the number of bytes transmitted and acknowledged
B represents :the number of bytes sent but yet to be acknowledged
C represents :the number of bytes that can be sent without waiting for
acknowledgement
D represents :the number of bytes that cannot be sent at present
CONGESTION CONTROL
TCP uses very helpful congestion control mechanism which can
overcome any possible overwhelming of the receiver by the
sender. This is a possibility for slow WAN links. TCP congestion
control algorithms can adapt the sender to the network
capacity at any point of time and thus avoid any potential
congestion situation. TCP follows a variety of congestion
control algorithm to avoid congestion, which are: Slow Start,
Congestion Avoidance, Fast Retransmit and Fast Recovery.
SLOW START is a process in which, once the connection is
established, a sender can send multiple segments depending
on the window size as advertized by the receiver. This is fine
when two hosts are on the same LAN, but poses serious
problem if there are routers and slow links in between. The
consequence is packets are dropped, performance is
degraded and the situation calls for retransmission.
• Slow start algorithm avoids such a situation. It operates on the
principle that packets can be injected into the network only at a
rate acknowledgements are received from the sender. The slow
start algorithm adds another window to the sender’s TCP. This is
called congestion window, abbreviated cwnd and is initialzed to one
segment only. Each time an ACK is received by the sender, it
increases its congestion window by one. The sender has the option
to send the lower value as imposed by the congestion window or
the advertised window as advertised by the receiving host. The
former is controlled by the sender and the latter by the receiver.
• CONGESTION AVOIDANCE algorithm is based on the assumption
that packet loss due to congestion is very small. Packet loss may be
ascertained from the following two: if a time out occurs or
duplicate ACKs received. Although slow start and congestion
avoidance algorithms are independent of each other, loss of packet
leads to implementation of both the algorithms at the same time.
Thus another algorithm – called a slow start threshold size,
abbreviated ssthresh, is used along with cwnd.
• In FAST RETRANSMIT ALGORITHM, TCP does
not wait for timeout to resend the lost
segments.
• FAST RECOVERY ALGORITHM is performed
fast retransmit. It is undertaken to allow for
high throughput under moderate congestion –
particularly for large windows. The first
retransmit and fast recovery algorithms are
normally implemented together.
UDP

• User Datagram Protocol (UDP) is a connectionless


protocol. It does not require any connection
establishment prior to data transmission. UDP does not
require sequence numbers, no timers, no
synchronization parameters, no retransmission of data
packets, no priority options. Thus it has very less
overhead. Its major drawback is that it does not
guarantee delivery. UDP is normally used for
broadcasting, general network announcements, for
real time data etc.
UDP HEADER FORMAT

The UDP header is shown in figure 18. It has only four fields.
• The source port is an optional one. When it is
used, it indicates the port address of the
sending process. When not used, a value of
zero is inserted for this field. The destination
port indicates the process to which the data is
to be delivered. The ‘length’ is the length in
bytes of the used datagram, including the
header. The checksum is an optional 16 bit
field, used for validation purposes.
IP
Internetworking layer in TCP/IP has some very important
protocols which are:
Internet protocol (IP),
Internet Control Message Protocol (ICMP),
Address Resolution protocol (ARP) and
Dynamic Host Configuration Protocol (DHCP).

They together perform


- datagram addressing,
- routing,
- delivery,
- dynamic address configuration and
- resolve issues between internetwork layer addresses
and the network interface layer addresses.
IP is an unreliable, connectionless and best effort
packet delivery protocol. Best effort delivery means
that packets sent by IP might be lost, may reach out of
order or even may get duplicated. It is the responsibility
of the higher layer to address these concerns.
Connectionless network protocol is used to minimize
the dependence on specific computing centers that
uses hierarchical connection oriented networks.
IP addressing is a must to identify a host on the
Internet. Thus each host is assigned an IP address or
an Internet address. A host is recognized by this IP
address. A host may be connected to more than one
network, called multi-homed, in which case the host
must have a separate address for each network
interface.
IP continued…
IP addresses are represented by a 32-bit unsigned binary
value and is expressed in a dotted decimal format.
Each IP address consists of a network number and a host
number. The network number is administered by one
of the three Regional Internet Registries (RIR):
American Registry for Internet Numbers (ARIN),
Reseaux IP Europeans (RIPE) and Asia Pacific Network
Information Centre (APNIC).
For example, 128.3.7.8, 128.3 is an IP address,
128.3 represents the network number while 7.8
represents the host number. Sometimes terms like
network address or netID are used instead of network
number while host address or hostID are used for host
number.
IP Datagram

An IP datagram (the basic data packet


exchanged between hosts) contains a source
IP address and a destination IP address. For a
datagram to be sent to a destination IP
address, it must be translated or mapped into
a physical address. For example, in LANs, the
IP address is translated into physical MAC
address by Address Resolution Protocol (ARP).
Datagram using IP has Five classes of IP
addresses: A, B, C, D and E.
• There are five classes of IP addresses: A, B, C, D and E.
• Class A address is suitable for an extremely large
number of hosts,
• class B for a small number of hosts,
• class C for medium sized networks with moderate
number of hosts.
• Class D is used for multicasting while class E for future
or experimental use.
• Delivery of datagrams using IP addresses can be any of
the following types: unicast, broadcast, multicast or
anycast. This is shown in figure 19.
Different Packet Delivery Modes
A connectionless protocol can send message in any of the four
methods, while a connection oriented protocol can only use
unicast addresses.
IPv4
IP version 4 (IPv4) is responsible for delivery of data
packets (datagrams) between the sending host to the
receiving host.
Different systems, for example, Ethernet can handle 1500
bytes while X.25 can handle 576 bytes. Because of this
frame size limitation, a message is broken up into
fragments, called datagrams.
To each datagram from an entire message is given an IP
header, which are then sent from the sending host. The
receiving host rebuilds the message from the
datagrams received.
The IPv4 header consists of at least five 32 bits ‘long
words’, i.e., 20 bytes in all and is shown in figure 20.
This IP header is appended to the information that it
receives from higher level protocols.
The IPv4 Header
• The ‘ver’ field is 4 bits long and indicates the IP
protocol version in use (in this case it is four).
• The 4-bit IHL (Internet header length) indicates the
length of the IP header. This header length is not a
fixed one. The ToS (type of service) field is 8-bit long
and its different bit positions correspond to minimizing
delay and monetary cost and maximize throughput and
reliability.
• The ‘total length’ corresponds to the length of the
datagram, measured in bytes. This field, along with IHL,
determine where data starts and ends.
• Maximum datagram length can be 216 = 65,536 bytes,
although such long datagram length is impractical.
Datagram lengths upto 576 octets are allowed.
The 16-bit identifier uniquely identifies each datagram sent by
the host with its value incremented by one each time a
datagram is sent.
When fragmentation of a message is necessary, the identifier
is appended to each successive fragments in order to
retrieve the datagram correctly at the receiver. The 3- bit
flag field follows the identifier field and has two flags.
These two flags are used in the fragmentation process with DF
(don’t fragment) set to 1 by the higher level protocol,
incase IP is not allowed to fragment a message.
When fragmentation is done, MF = 1 indicates that more
fragments follow. The last fragment has MF = 0 in its flag
field.
• The fragment offset is 13-bit long and indicates
where in the original datagram a particular
datagram belongs.
• The TTL (time to live) sees to it that datagrams
which can not be delivered are ultimately
destroyed.
• The protocol field is 8-bit long and indicates the
next higher level protocol header present in the
data portion of the datagram.
• The checksum header is a checksum on the
header portion only. Both source and destination
addresses are 32-bit long each and represent the
origin host and target host respectively.
OPERATION:
TCP/IP protocol suite helps in sending a message
from a process associated with a port residing at
a host to another process associated with a port
at a second host. The receiving host may reside
on the same network or on another network. For
the latter case, the message has to pass through
several routers along its passage to the final
destination. It should be borne in mind that IP is
implemented in all the end systems and the
routers while TCP is implemented only in the end
systems.
As already mentioned two levels of addressing are needed for a
process data in one host to be sent to another process in
another host. A local port address is needed which would
ensure correct data delivery a
t the process at the receiving host. Again a network address is
needed which would enable the message to be delivered to the
receiving host.
• Let a process data residing at a port belonging to a
host is to be delivered at another process having its
own port address and belonging to another host. The
sending end process hands the message down to TCP.
It has instructions to send the same to the second host
at the particular port. TCP hands over the message to
IP with instructions to deliver the same to the second
host. IP is remaining to be totally transparent about the
port address of the destination host. All these are
managed by control information appended to the
message at each layer of the TCP/IP protocol suite.
PDUs IN ARCHITECTURE:

Control informations, in the form of headers and trailers, are


appended to the message at the different layers to ensure
proper data delivery at the proper destination with utmost
reliability. Next Figure shows the Data encapsulation and
PDUs in the TCP/IP architecture.
At the TCP layer, control information, in the form of TCP header,
is appended forming a TCP segment or a Protocol Data Unit
(PDU) of TCP.
Control information which are included in the TCP header are:
- destination port address,
- sequence number and
- checksum.
Similarly, at the network layer, an IP header is added, giving rise
to PDU of IP. The IP header includes destination network
address. It may include some other control information like
priority in data delivery etc.
Data Encapsulation and PDUs in TCP/IP Architecture
ADDRESSING:
Addressing through the TCP/IP protocol involves sending data from
one process to another via the internet. The addressing involves the
following categories: Physical or Link, Logical or IP, Port and Specific.
The addresses refer to specific layers in the TCP/IP model
Addresses and their corresponding layers in the TCP/IP Model(figure)
1 PHYSICAL:

The physical or link address is the lowest level address. It is the address
of a station or node specified in its frame by LAN or WAN. Depending
on the type of the network, the size and the format of the address
vary. Ethernet uses a 6 byte address which is embedded in its NIC.

2 LOGICAL:
Logical address corresponds to the network layer in the TCP/IP
model. The physical address may vary – depending on the type of
the network. Logical address overcomes this difficulty by
recognizing a host irrespective of the physical address type. At
present, a 32 bit logical address can uniquely recognize a host
connected to the internet. No two IP addresses can be same so
that two different hosts can be differentiated and recognized with
their logical addresses.
3 PORT:
A computer may run several processes at the same time. It may
communicate with a second computer via a file transfer protocol,
message handling services or TELNET. Thus these processes residing on
a computer must have individual separate addresses for them to
receive data from other computers simultaneously. This is taken care
of by port addresses. A port address is 2 bytes in length. Thus it is the
port address on a computer which helps in exact data/message
delivery meant for a particular process once it has reached its
destination host.

4 SPECIFIC:
Specific addresses are user friendly addresses like e-mail address
or an URL (Universal Resource Locator). An e-mail address locates
a particular recipient in any part of the world while an URL helps
in locating some document/writing/information available from
the World Wide Web.

You might also like