TCP/IP was developed to allow cooperating computers to share resources across a network and to connect a number of different networks designed by different vendors into a network of networks, the Internet. It handles network communications between network nodes.
TCP/IP is a suite of several protocols, which handles the movement of data between computers. This Internet protocol suite includes not only lower-level specifications such as TCP and IP, but also specifications for e-mail, terminal emulation, and file transfer.
The TCP (Transmission Control Protocol) is a connection-oriented transport protocol and is responsible for breaking up the message into datagrams, verifying the correct delivery of data from client to server, reassembling them at the other end, resending anything that gets lost and putting things back in the right order. TCP can also recognize duplicate messages and will discard them appropriately.
IP (Internet Protocol) is the primary layer 3 protocol in the Internet suite and is responsible for routing the individual datagrams from node to node. The IP component provides routing from the LAN to regional networks and finally to the global Internet.
The data are sent as datagrams. TCP puts a header at the front of each datagram, the most important ones are a source and destination "port number" and a "sequence number".
TCP sends each of the datagrams to IP and tells IP the Internet address of the computer at the other end. IP 'doesn't care' about what is in the datagram and the TCP header. The job of IP is to find a route for the datagram and get it to the other end. In order to allow gateways or other intermediate systems to forward the datagram, it adds its own header. The main information in this header is the source and destination Internet IP address, the protocol number and another checksum.
The IP addresses are globally unique, 32-bit numbers assigned by the Network Information Center (like 322.214.171.1243). The IP address is a four byte value that (by convention) is expressed by converting each byte into a decimal number (0 to 255) and separating the bytes by a period.
"Class C" network are smaller networks, in which the first three bytes identify the network and the last byte identifies the individual computer. Larger organizations can get a "Class B" network where the first two bytes only identify the network and the last two bytes identify the individual workstations (up to 64 thousand).
Ethernet Devices over TCP/IP:
Ethernet controller comes with an address builtin from the factory. In order to make sure that they would never have to reuse addresses, the Ethernet designers allocated 48 bits for the Ethernet address. There is no connection between the Ethernet address and the Internet address. Each machine has to have a table of what Ethernet address corresponds to what Internet address.
When data packets are received by the other end, all the headers are removed. IP removes the IP header. Since the protocol type is TCP, it passes the datagram to TCP. TCP looks at the sequence number. It uses the sequence numbers and other information to combine all the datagrams back into the original file.