What is TCP/IP and how does it work
TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication protocol used by internet and intranet. TCP/IP is a two-layer protocol, The higher layer TCP protocol divides the message into smaller packets called segments and transmits those segments over the network. The lower layer IP protocol manages the addressing part of the packets. Each router used in the network checks these addresses to determine where to forward the packets so that they will reach the correct destination.
Prior to the OSI Model, the TCP/IP protocol suite was developed. Physical, Data Link, Network, Transport and Application are the five layers of TCP/IP protocol suite. The first four layers of the TCP/IP protocol provide physical connectivity, addressing, internetworking and transport functions. These functions match with the first four layers of the OSI model. The Application layer includes the functions of top 3 layers of OSI model.
TCP/IP Protocol Suite Layers
Physical and Data Link Layer Protocol:
- TCP/IP does not define any particular protocol at the physical and data link layer.
Network Layer Protocol
- ARP (Address Resolution Protocol): It is used to translate an IP Address into a MAC Address. Each device has a physical address imprinted on the Network Interface Card (NIC).
- RARP (Reverse Address Resolution Protocol): It translates a MAC Address into an IP Address.
- ICMP (Internet Control Message Protocol): Its only function is to report a problem to the original sender not to correct them. It is used to check error in a network connectivity and Ping command is the best example of ICMP protocol.
- IGMP (Internet Group Message Protocol): Multi-casting process uses IGMP protocol. It transmits message to the multiple recipients at the same time.
Transport Layer Protocol
- TCP (Transmission Control Protocol): It is a connection-oriented and reliable transport protocol. It divides data into segments each having a sequence number. So, these sequence numbers are used at the receiving end to rearrange the segments into original order. TCP protocol requires while sending large files.
- UDP (User Datagram Protocol): It is a connectionless and unreliable transport protocol. It cannot send data in a sequence and does not offer error checking feature. So, if it lost some packets while sending data it is not going to fix it and ignore. Video calling apps and online games use UDP protocol to stream online.
Difference between TCP and UDP Protocol
Application Layer Protocol
The application layer includes the Session, Presentation and Application layers of the OSI model. Many protocols such as SMTP, FTP, DNS, SNMP, NFS, RPC, and TFTP are defined at this layer
- SMTP (Simple Mail Transfer Protocol): It helps in sending email messages with an attachment to single or multiple recipients in a network.
- FTP (File Transfer Protocol): It helps in exchanging files from one host to another connected over the Internet.
- DNS (Domain Name System): It is used to translate an IP Address into a hostname or vise versa.
- NFS (Network File System): Allows computers on different operating systems to share files and disk in e storage.