II. TCP/ IP Protocol Architecture
The OSI model has seven layers while TCP/IP has three o five (based on
descriptions from various literature). In this section, we consider the four layers
as defined by Hunt (1994);
1. Network access layer- consists of routines for accessing physical networks.
2. Internet layer- defines the datagram and handles the routing of the data.
3. host- to host transport layer- provides and end- to end data delivery services
4. application layer- consists of applications and process that use the network
As in the OSI model, data is passed down the layers (application to network
access layer) when they are being sent to the net, and up (network access to
application layer) when they are being received from the network. As data move
from application layer to network access layer, each layer adds control
information is called a header because it is placed in front of the data to be
transmitted. Each layer simply accepts information from a layer above, treats this
as data, and blindly places its own header infront. This process of adding a
header or delivery information is called encapsulation. When data is received, the
opposite happens, i.e., the data is tripped of headers. Later we will learn that
there are two important protocols at the transport layers, namely:
Transmission Control Protocols (TCP) and User Datagram Protocol (UDP).
Each layer in the architecture and protocol has its own view of data (or data
structure). Consequently, each layer is unaware of the data structures used by
others layers. The application layer refers to data as a stream in TCP and message
in UDP, the transport layers refers to data as segment in TCP and packet in UDP, the
internet layers refers to the data as datagram in TCP and UDP and the network access
layers refers to data as frame in TCP and UDP. The table below summarizes this.

Network access layer
This is the lowest layer and it provides a means for the system to deliver
data to other devices on directly attached network. Unlike the other higher-level
protocols, network access layers protocols must know the details of the
underlying network, like packet structure, frame size and addressing, to correctly format the data being transmitted to comply with the network constraints. Functions performed at the network access layer include encapsulation of IP datagram into the frames transmitted by the network, and mapping IP addresses to physical addresses used by the network. One of the strengths of TCP/ IP is the addressing scheme that uniquely identifies every host in the internet. This IP address must be converted into whatever address is appropriate for physical network over which the data is transmitted.
Internet layer
The most important protocol in the internet layer is the Internet Protocol
(IP). This is responsible for routing messages in the network. The layers above
and below the internet layer use IP regardless of its final destination. IP is a
connectionless protocol, i.e., no end-to-end connection is needed before data are transmitted. IP, however, relies on protocols in other layers to establish
connections for connection-oriented services. IP also relies on protocols in other layers for error recovery. This means IP itself does not check for errors; other layers in the TCP/ IP architecture do.
The IP’s function includes:
1. Defining the datagram (the data format in the internet layer);
2. Defining the internet addressing scheme;
3. Moving data between the network access layer and the transport layer;
4. Routing datagrams to remote hosts; and
5. Performing fragmentation and re-assembly of datagrams.
The datagram is the packet format defined by IP. Figure 5.1 illustrates a
datagram. The first five 32-bit words comprise the header; the next word is
optional but is still part of the header. The presence or absence of the optional
word is known from the value of Internet Header Length (IHL). This header
contains all the information needed to deliver the datagram.
In delivering datagrams, the IP first examines the destinations address. If
the Destination address is the address of the host on the local network, then the Datagrams is delivered directly to the destination. Otherwise, the datagram is passed to a gateway for delivery. Gateways are devices that switch packets between the different physical networks. Deciding which gateway to use is called routing. The IP makes a routing decision for each individual packet. As a datagram is routed through the network, it may be necessary for the IP module in a gateway to divide the datagram into smaller pieces. This happens when the datagram received in a gateway is too large to be transmitted in a single packet on a different network. Remember that the Internet is an interconnection of network. Has a maximum transmission unit (MTU), which is the largest packet that it can transfer. If a datagram received from one network is longer than the network is longer than the network’s MTU, then this datagram will have to be divided into smaller fragments for transmission. This process is called fragmentation.
The format of each fragment is the same as the format of any normal datagram. However, the header will have additional information –information that identifies each datagram fragment and provides information about how to re-assemble the fragments back into the original datagram.
An important integral part of IP is the Internet Control Message
Protocol (ICMP). This protocol performs control, error reporting and
informational functions, as follows:
1. Flow control- When a host sends datagrams too quickly that the
receiver host or intermediate gateway is unable to handle the incoming
datagrams, then the said gateway or host may send back to the
sender an ICMP source quench message. This message tells the Source to stop sending datagrams temporarily because a part of the network is having difficulty handling the datagrams it is sending.
2. Detect unreachable destinations- The normal rule is that any gateway
in between sends back to the sender a destination unreachable message
when this detected. But if the unreachable destination is a port rather than a host or network, then it is the destination host where the port is found that sends back the destination unreachable message.
3. Redirect routes-When a host is connected to more than one gateway,
then the gateway where datagrams are currently routed may send an
ICMP redirect message to the source host to use another gateway
because it will be a better choice.
4. Check remote host- A host can send an ICMP echo message to a
remote system to check if the IP of the remote system is up operational. When a remote system receives an echo message, it sends this back to the source host. The UNIX ping command use this message.
Transport layer
The transport layer is a layer in between the application and internet
layers. There two very important protocols in the transport layer: the
Transmission Control Protocol(TCP) and the User Datagram Protocol
(UDP). TCP provides reliable data delivery with end- to- end error detection and correction while UDP provides low- overhead connectionless datagram delivery service. Both protocols can delivery data between the application and internet layers. Application programmers can choose which of the two is more appropriate for their specific applications.
UDP provides application programs direct access to a low-level datagram delivery Service –the datagram delivery service provided by IP – thus allowing
Applications to exchange messages with minimum overhead. As an IP, UDP is an unreliable (in the sense that no error detection and correction is done in the Protocol, but this may be done in other layer) and connectionless protocol. Within the same computer, UDP will deliver data correctly. UDP will deliver data correctly. UDP uses 16-bits Source Port and Destination Port numbers ( Figures 5-2) to deliver data to correct applications process.
TCP provides reliable data delivery service since it verifies that data is
delivered across the network accurately and in the proper sequence. TCP is a
protocol that is reliable, connection – oriented and byte- system. Reliability is
ensured in TCP through a mechanism called positive Acknowledgement with Re- transmission (PAR). The idea is that a source host using PAR sends the data again, unless it receives a message from port layer is in the form of
segments (Figure 10-3). Each segment contains the received segment if undamaged, the receiver sends back a positive acknowledgement to the sender. Otherwise, the receiver discards the segment. After an appropriate time the sending TCP module re-transmits any segment if no positive acknowledgement has been received.
TCP is connection – oriented in the sense that it establishes a logical end-
to-end connection between two communicating hosts. Control information, called handshake, exchanged between the two communicating hosts. Control information, before data is transmitted. TCP uses a three- way handshake because three segments are exchanged. To illustrate, consider the case host a trying to connect to host B. Host A sends to B a segment with the
Synchronize Sequence Number (SYN) bit set (this is found in the space for Flags in the segment). With the SYN bit set, this tells B that A wants to establish a connection and if further tells B what sequence number host A will use as a starting number host B will start with. Finally, host A sends a segment that
acknowledges receipt of B’s segment, and transfers the first actual data. When the data transfer is completed, both hosts will again exchange a three-way handshake with segments containing the No More Data from sender (FIN) bit set to close the connection.
TCP views data it sends as s continuous stream of bytes. Hence, TCP takes care of monitoring which bytes are sent and received. The monitoring is achieved through the use of the sequence number and acknowledgement number.The two ends of the connection first synchronize byte-numbering
systems by exchanging SYN segments during handshake. During handshake the initial sequence number (ISN) is set. Though not required, ISN is usually set to 0. Each byte of data is numbered sequentially from ISN so the first real byte of data is ISN+1. the sequence number in the header of a data segment
identifies the sequential position of the first data in the segment.
The ACK segment performs two functions, namely: acknowledgement
and flow control. The acknowledgement tells the sender how much data has
been received and how much more receiver can accept. The acknowledgement number is the sequence number of the last byte received at the remote end. The window field of the acknowledgement contains the number of bytes the remote end is able to accept. The window, therefore, informs the sender that it can continue sending segments for as long as the total number of bytes by changing data until it receives a non-zero window in the acknowledgement.
To illustrate, consider the diagram in Figure 10-4. In the diagram, ISN is 0. The receiver has acknowledged receipt of 1000 bytes. It sends this in the acknowledgement together with the information that window size is 3000 byte. The sender receiving this continues to send because it has sent only 1000 bytes (sequence number 1001 to 2000) and this is still within the window size (although this has not been acknowledged yet). If the sender fills the window and does not receive any acknowledgement after some time, then re- transmission would start from byte 1001.






Application layer
Found at the top of the TCP/IP protocol architecture, this is where the user interacts with network. All applications programs that run on the network are in this layer. There programs use either TCP or UDP to communicate with other machines. The most widely known application layer protocols are:
1. Network Terminal Protocol (telnet) - enables users to execute terminal sessions with Remote hosts.
2. File Transfer Protocol (FTP) - performs basic interactive file transfer between hosts.
3. Simple Mail Transfer Protocol (SMTP)- delivers electronic mails.
4. HyperText Transfer Protocol (HTTP) - supports low-overhead transport of files consisting of a mixture of text and graphics.
These four applications use TCP. Applications that use UDP are:
1. Domain Name system (DNS)- maps IP addresses to the domain names (Names assigned to network devices), also called
name service.
2. Routing Information Protocol (RIP) - facilities exchange of routing information by Network devices.
3. Network File System (NFS) - facilities sharing of files by various hosts in the Network.
Figure 5-5 is a diagram illustrating the dependencies of these protocols.
