TCP/IP also is a layered protocol but does not use all of the OSI layers, though the layers are equivalent in operation and function (Fig. 2). The network access layer is equivalent to OSI layers 1 and 2. The Internet Protocol layer is comparable to layer 3 in the OSI model. The host-to-host layer is equivalent to OSI layer 4. These are the TCP and UDP (user datagram protocol) functions. Finally, the application layer is similar to OSI layers 5, 6, and 7 combined.
The TCP layer packages the data into packets. A header that’s added to the data includes source and destination addresses, a sequence number, an acknowledgment number, a check sum for error detection and correction, and some other information (Fig. 3). The header is 20 octets (octet = 8 bits) grouped in 32-bit increments. These bits are transmitted from left to right and top to bottom.
At the receiving end of the link, TCP reassembles the packets in the correct order and routes them up the stack to the application. TCP can retransmit a packet if an error occurs. In any case, TCP’s main job is just to pack and unpack the data and provide some assurance of the reliable transmission of error-free data. The IP layer actually transmits the TCP packet.
The IP layer transmits the data over the physical-layer connection. IP adds its own header to the packet (Fig. 4). The header comprises 32 octets again grouped in 32-bit words. Note the 32-bit source and destination addresses. These are the well-known IP addresses that we see in dotted decimal format (e.g., 22.214.171.124) where each 8-bit octet is expressed in its decimal value. This is the address assigned to the device by the Internet Assigned Numbers Authority (IANA).
The header in Figure 4 is that used in IP version 4 (IPv4). Since the IANA has run out of 32-bit addresses (232 of them!), a newer version is rapidly being adopted. IPv6 uses 128-bit addresses(Fig. 5). With 2128 addresses, there should be enough for all of the planet’s computers, tablets, and smart phones as well as all of the devices that may be connected to form the so-called Internet of Things (IoT).
Once the IP header is added to the data, it is transferred to the Network Access layer. This layer repackages the data again into Ethernet packets or some other protocol for final physical transmission. The Ethernet packets are then reconfigured again for transmission over a DSL or cable TV connection or over a wide-area network using Sonet or optical transport network (OTN).
TCP/IP is the older of the two approaches to data communications and is well established throughout the world. The OSI model, however, is a proven concept that is used in all other data communications protocols. It will continue to be used as a guideline for all other communications applications.