TCP/IP ( Transmission Control Protocol / Internet Protocol ) stands for a set of protocols and not just 2 protocols tcp and ip. But as tcp and ip are the two most imporatant protocols, the whole set is is known as TCP/IP.
Protocol: Protocol is a set of rules that must be followed by two machines a network in order to communicate with each other irrespective of their platforms.
Previously OSI protocols were used widely. But they were based on out-dated concepts. OSI couldn’t see the light of the day. On 1, January,1983 APRANET accepted TCP/IP as it’s standard protocol. Many consider that as the birth of internet.
TCP/IP has four layers. These layers are logical and not physical. one must understand the logic that caused the division.
- Application Layer – Represents the application
- Transport Layer – Controls reliability of transmission
- Internet Layer – Takes care of addressing the packets
- Network Access Layer – Convert IP address into MAC address
Data originates at the application layer and then travles through all other layers. At the transport layer, the data is broken into chunks. The chunks have different names at the different layers, but they are universaly known as datagrams. Each layer adds it’s own inforrtmation known as header, to the data received from the upper layer. Thus encapsulation is achieved. At the receiving end, data goes into exactly oposite direction.
Now let’s look at the layers of TCP/IP stack in brief.
Application Layer
This layer contains various services like ftp, telnet, DNS, NFS, HTTP. Data originates at this layer and fed into transpost layer in form of stream. Application layer doesn’t add any header to the stream.
Services like telnet, ftp, HTTP uses tcp protocol. Where DNS, NFS uses udp protocol. We will look into tcp and udp later in this tutorial.
Transport Layer
Transport layer features 2 proptocols. TCP and UDP. TCP is a reliable and connection oriented protocol. It provides for error detection and recovery facilities. UDP is unreliable and connectionless protocol. It doesn’t care wether data has reached the destination or not. But UDP is somewhat faster than TCP protocol.
TCP first divides the stream received from application layer, into segments and adds it’s own header. The header ususally contains the information required for reliable transmission. TCP exchnage data in a 3-way handshake. It first sends a segment, wait for a positive acknowledgement from the transport layer of the remote machine. And after receiveing acknowledgement, it sends one acknowledgement again. After this the connection is said to be established. Then TCP proceeds with data transfer.
Where UDP is connection-less protocols. It directly sends the data without caring if the destination machine is reachable or not.
Internet Layer
This layer takes care of addressing requirments. It also plays role in determing the route of the packet to reach the destination. The main protocol in this layer is IP ( Internet Protocol ). It often uses services of ICMP ( Internet Control Message Protocol ).
IP headers includes both, soyrce and destination address (what we call is IP address ). IP is unreliable protocol. It has no facility for error detection.
Network Access Layer
This is the last layer of acknowledgement stack. It is the layer which has a knowldege of underlying hardware. It accepts the packets from IP layer and encapsulate them after converting all IP addresses into MAC addresses. Then it sends the data to the wire ( physical entity ). ARP ( Address Resolution Protocol ) is the main protocol of this layer. MAC address is a set of six colon delimited hexadecimal numbers. For example, 0:10:AB:34:1E:20. IEEE and other international organizations have ensured the uniqueness of MAC addresses throughout the world.
That’s all. I hope this will help you understand TCP/IP in a better manner. Please give your feedback about it.