TCP/IP Protocol Introduction
In the two decades since their invention, the heterogeneity of networks has expanded further with the deployment of Ethernet, Token Ring, Fibre Distributed Data Interface (FDDI), X.25, Frame Relay, Switched Multimegabit Data Service (SMDS), Integrated Services Digital Network (ISDN), and most recently, Asynchronous Transfer Mode (ATM). The Internet protocols are the best-proven approach to internetworking this diverse range of LAN and WAN technologies.
The Defense Advance Research Projects Agency (DARPA) originally developed Transmission Control Protocol/Internet Protocol (TCP/IP) to interconnect various defence’s department computer networks. TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication language or protocol of the Internet. It can also be used as a communications protocol in a private network (either an intranet or an extranet).
TCP/IP uses the client/server model of communication in which a computer user (a client) requests and is provided a service (such as sending a Web page) by another computer (a server) in the network.
TCP/IP communication is primarily point-to-point, meaning each communication is from one point (or host computer) in the network to another point or host computer. TCP/IP and the higher-level applications that use it are collectively said to be "stateless" because each client request is considered a new request unrelated to any previous one (unlike ordinary phone conversations that require a dedicated connection for the call duration).
Being stateless frees network paths so that everyone can use them continuously. (Note that the TCP layer itself is not stateless as far as any one message is concerned. Its connection remains in place until all packets in a message have been received.)
TCP/IP is composed of layers:
TCP - is a connection-oriented transport protocol that sends data as an unstructured stream of bytes. By using sequence numbers and acknowledgment messages, TCP can provide a sending node with delivery information about packets transmitted to a destination node, it is responsible for verifying the correct delivery of data from client to server.
Where data has been lost in transit from source to destination, TCP can retransmit the data until either a timeout condition is reached or until successful delivery has been achieved. TCP can also recognize duplicate messages and will discard them appropriately. TCP adds support to detect errors or lost data and to trigger retransmission until the data is correctly and completely received.
If the sending computer is transmitting too fast for the receiving computer, TCP can employ flow control mechanisms to slow data transfer. TCP can also communicate delivery information to the upper-layer protocols and applications it supports.
TCP/IP Network Model
The TCP/IP model does not exactly match the OSI model. While there is no universal agreement about how to describe TCP/IP with a layered model, it is generally viewed as being composed of fewer layers than the seven used in the OSI model.
Most descriptions of TCP/IP define three to five functional levels in the protocol architecture. The four-level model is based on the three layers (Application, Host-to-Host, and Network Access) shown in the DOD (Department Of Defense) Protocol Model in the DDN (Defense Data Network) Protocol Handbook - Volume 1, with the addition of a separate Internet layer.

Animation 5.17 A comparison between OSI reference model and DOD Department Of Defense) Protocol Model
This model provides a reasonable pictorial representation of the layers in the TCP/IP protocol hierarchy and a relationship of the Internet Protocol Suite to the OSI Reference Model.

Animation 5.18 The relationship of the TCP/IP Model to the OSI Reference Model
The four-layer structure of TCP/IP is built as information is passed down from applications to the physical network layer. When data is sent, each layer treats all of the information it receives from the layer above as data and ads control information to the front of that data.
This control information is called a header, and the addition of a header is called encapsulation. When data is received, the opposite procedure takes place as each layer removes its header before passing the data to the layer above.
IP - is responsible for moving packet of data from node to node. IP forwards each packet based on a four-byte destination address (the IP number). IP is the primary layer 3 protocols in the Internet suite.
In addition to internetwork routing, IP provides error reporting and fragmentation and reassembly of information units called datagrams for transmission over networks with different maximum data unit sizes. IP represents the heart of the Internet protocol suite.
IP addresses are globally unique, 32-bit numbers assigned by the Network Information Centre. Globally unique addresses permit IP networks anywhere in the world to communicate with each other.
The Internet authorities assign ranges of numbers to different organizations. The organizations assign groups of their numbers to departments. IP operates on gateway machines that move data from department to organization to region and then around the world.
An IP address is divided into three parts. The first part designates the network address, the second part designates the subnet address, and the third part designates the host address.
IP addressing supports four different network classes. Class A networks are intended mainly for use with a few very large networks, because they provide only 8 bits for the network address field. Class B networks allocate 16 bits, and Class C networks allocate 24 bits for the network address field. Class C networks only provide 8 bits for the host field, however, so the number of hosts per network may be a limiting factor. Class D addresses are used for Multi-casting protocols exclusively.
IP addresses are written in dotted decimal format; for example, 34.0.0.1. The IP address Class is defined by the setting of the TOP 4 bits of the IP address. The IP Class provides the separation between the host and the network part of the IP address as defined below:
Table 5.5 Definition of the IP address (host and the network part)
Class |
Address |
Bits 28-31 |
Network bits |
Host bits |
Netmask |
A |
100.0.0.0 |
0xxx |
8 |
24 |
255.0.0.0 |
B |
169.25.0.0 |
10xx |
16 |
16 |
255.255.0.0 |
C |
192.232.165.0 |
110x |
8 |
24 |
255.255.255.0 |
D |
224.0.0.0 |
1110 |
- |
- |
- |

Animation 5.19 The TCP/IP network classes
The terms Netmask simply refers to a way of separating the Network Address and the Host Address parts of the IP address. Every network created by a Netmask is defined by the standards to have two special IP addresses as follows:
- A host address of all zeros is the multi-cast address for the network
- A host address of all 1s is the broadcast address for the network
IP networks also can be divided into smaller units called subnetworks or "subnets". For example, assume that a network has been assigned a Class B address and all the nodes on the network use a Class B address.
Further assume that the dotted decimal representation of this network's address is 34.0.0.0. (All zeros in the host field of an address specify the entire network.) The administrator can subdivide the network using sub netting.

Animation 5.19 The IP network is divided into sub networks or "subnets"
The number of bits that can be borrowed for the subnet address varies. To specify how many bits are used and where they are located in the host field, IP provides subnet masks. Subnet masks use the same format and representation technique as IP addresses.
Subnet masks have ones in all bits except those that specify the host field. For example, the subnet mask that specifies 8 bits of sub netting for Class A address 34.0.0.0 is 255.255.0.0.
The subnet mask that specifies 16 bits of sub netting for Class A address 34.0.0.0 is 255.255.255.0. Both of these subnet masks are pictured in.
Sockets - is a name given to the package of subroutines that provide access to TCP/IP on most systems.
Routing in IP Environments
Routers used for information exchange within autonomous systems are called interior routers, and they use a variety of interior gateway protocols (IGPs) to accomplish this end. Routers that move information between autonomous systems are called exterior routers; they use the Exterior Gateway Protocol (EGP) or Border Gateway Protocol (BGP).

Animation 5.21 The routing process in the Internet architecture
In the Internet architecture a dynamic routing algorithms adapt to changes in the network and automatically select the best routes. In contrast with dynamic routing, static routing calls for routes to be established by the network administrator. Static routes do not change until the network administrator changes them.
IP routing specifies that IP datagrams travel through an internetwork one router hop at a time. The entire route is not known at the outset of the journey. Instead, at each stop, the next router hop is determined by matching the destination address within the datagram with an entry in the current node's routing table.
Each node's involvement in the routing process consists only of forwarding packets based on internal information. IP does not provide for error reporting back to the source when routing anomalies occur. This task is left to another Internet protocol: the Internet Control Message Protocol (ICMP.)
Internet technology applied to home automation is more or less standard internet, i.e. making devices, components and appliances web aware, with IP-enabled so that managing and monitoring can be done by web browser. An IP-camera is a camera with an embedded web browser. Such a camera can be connected directly to a TCP/IP infrastructure and from the Internet either as an intranet or even on the world wide Internet the camera can be viewed, but also monitored, managed and maintained by a standard web browser.