The Four/Five Layers of TCP/IP
The TCP/IP model (Internet model) is the practical foundation of the Internet. The original RFC model has 4 layers: Application, Transport, Internet, Network Access (Link). Many textbooks (Forouzan) use a 5-layer version: Application, Transport, Network (Internet), Data Link, Physical. The TCP/IP Application layer combines OSI's Application + Presentation + Session. The TCP/IP Network Access layer combines OSI's Data Link + Physical (in the 4-layer view). Key protocols by layer: Application = HTTP, FTP, SMTP, DNS, SNMP, TELNET; Transport = TCP, UDP; Internet = IP, ICMP, IGMP, ARP (debated placement); Link = Ethernet, Wi-Fi. Remember: TCP/IP has fewer layers and was built before its model was formally defined.
OSI vs TCP/IP - Key Differences
OSI has 7 layers; TCP/IP has 4 (or 5). OSI is a reference/theoretical model (protocols defined after the model); TCP/IP is protocol-driven (model defined after protocols). OSI strictly separates services, interfaces, and protocols; TCP/IP does not. OSI's Network layer supports both connectionless and connection-oriented service; OSI Transport is only connection-oriented. TCP/IP's Internet (Network) layer is connectionless only; its Transport layer supports both (TCP=connection-oriented, UDP=connectionless). OSI was a documentation model that largely failed commercially; TCP/IP succeeded as the Internet standard. Mapping: OSI top 3 (App+Pres+Session) = TCP/IP Application; OSI bottom 2 = TCP/IP Network Access.
Protocol-to-Layer Mapping (Memory Aid)
GATE CSE almost never lets a Computer Networks paper escape without one or two questions on which protocol sits at which layer of the TCP/IP suite. The questions are mark-rich and time-cheap once you have the mapping memorised cleanly.
Definition: The TCP/IP model is the four-layer architecture (Link, Internet, Transport, Application) that actually runs the Internet. Every protocol that moves data over the network has a "home layer" where it does its main job.
Definition: A port number is a 16-bit identifier that the Transport layer uses to deliver data to the correct application โ for example, port 80 for HTTP and port 443 for HTTPS.
A quick map of the layers
The TCP/IP suite (often called the Internet model) has four layers, from bottom to top:
- Link layer (also called Network Access / Data Link) โ moves raw frames over a physical medium.
- Internet layer (Network layer) โ routes packets between networks.
- Transport layer โ provides process-to-process communication.
- Application layer โ provides services directly to user programs.
Some textbooks split the bottom into Physical + Data Link to align with the seven-layer OSI model, but the protocols stay in the same places.
Application-layer protocols (well-known ports)
These protocols use either TCP or UDP (or both) underneath, and most have a well-known port number that GATE loves to test.
- HTTP โ HyperText Transfer Protocol โ port 80 (TCP). Carries the World Wide Web.
- HTTPS โ HTTP over TLS โ port 443 (TCP). The secured version.
- FTP โ File Transfer Protocol โ uses two TCP ports: 21 for control and 20 for data.
- SMTP โ Simple Mail Transfer Protocol โ port 25 (TCP). Pushes mail between mail servers.
- POP3 โ Post Office Protocol v3 โ port 110 (TCP). Pulls mail from a server to a client.
- IMAP โ Internet Message Access Protocol โ port 143 (TCP). Synchronises mail.
- DNS โ Domain Name System โ port 53. Uses UDP for ordinary queries and TCP for zone transfers and large responses.
- DHCP โ Dynamic Host Configuration Protocol โ ports 67 (server) and 68 (client). Uses UDP because the client does not yet have an IP address when it sends the first packet.
- TELNET โ port 23 (TCP). Remote login (insecure).
- SSH โ Secure Shell โ port 22 (TCP). Secure remote login.
- SNMP โ Simple Network Management Protocol โ port 161 (UDP) for agents and 162 for traps.
- TFTP โ Trivial FTP โ port 69 (UDP). Used in PXE boot and network device firmware loads.
Transport-layer protocols
Only two matter for GATE in the TCP/IP world:
- TCP โ Transmission Control Protocol. Connection-oriented, reliable, byte-stream. Provides three-way handshake, sequence numbers, acknowledgements, retransmission, flow control (sliding window) and congestion control. Used by HTTP, HTTPS, FTP, SMTP, POP3, IMAP, TELNET, SSH.
- UDP โ User Datagram Protocol. Connectionless, unreliable, message-oriented. No handshake, no acknowledgements, no congestion control. Used where speed matters more than reliability โ DNS queries, DHCP, TFTP, SNMP, VoIP, online games, video streaming.
GATE often asks comparisons: "Which of the following is connection-oriented?", "Which protocol is used by DHCP?" โ and the answers depend on this short list.
Internet (Network) layer protocols
- IP (IPv4 / IPv6) โ Internet Protocol. The layer's workhorse: it provides best-effort, connectionless routing of packets from source to destination.
- ICMP โ Internet Control Message Protocol. Carries network-control messages such as echo request/reply (ping), destination unreachable, time exceeded (used by traceroute), and redirect. ICMP messages are encapsulated inside IP datagrams but are considered part of the Internet layer alongside IP.
- IGMP โ Internet Group Management Protocol. Used by hosts and routers to manage multicast group membership. Also encapsulated within IP.
- ARP โ Address Resolution Protocol. Maps an IPv4 address to a MAC address on the local link. ARP sits at the boundary between the Link and the Internet layer โ it is essentially Link-layer in operation, but it is needed for Internet-layer addressing to work. Different textbooks place it differently; both Forouzan and Tanenbaum are common GATE references and disagree slightly. GATE itself usually treats ARP as Link layer.
- RARP โ Reverse ARP โ maps a MAC to an IPv4 address; obsolete, replaced by DHCP.
In IPv6 the equivalent of ARP is NDP (Neighbour Discovery Protocol), which uses ICMPv6.
Link-layer protocols
These live at the bottom and deal with frames on a wire or air.
- Ethernet (IEEE 802.3) โ the dominant wired LAN technology.
- Wi-Fi (IEEE 802.11) โ wireless LAN.
- PPP โ Point-to-Point Protocol. Used historically for dial-up, modern WAN links and PPPoE/PPPoA.
- Token Ring (IEEE 802.5) โ legacy LAN technology, mostly of historical interest, but it still appears in GATE memory aids.
- HDLC โ High-level Data Link Control โ used in some WAN links.
Why it matters
GATE CSE typically allocates two-to-three marks on Computer Networks to "layer mapping" or "which protocol is connection-oriented" questions. These are pure-recall questions with very low solving time. If you can hold the mapping below in your head, you save 5-7 minutes in the paper and almost guarantee 2-3 marks. Even when the question is wrapped inside a wireshark trace or a routing scenario, the answer almost always reduces to "find the protocol, identify the layer, recall its port".
Real-world example: When you type gate.iitd.ac.in in a browser, your machine first sends a DNS query (UDP, port 53, Application layer). The DNS reply gives an IP address. The browser then opens a TCP connection (Transport) to that IP on port 443. Routing happens at the IP (Internet) layer; an intermediate router may send back an ICMP "time exceeded" message if a TTL expires. On your LAN, ARP is used to find your default gateway's MAC address (Link). Finally, the actual web page arrives via HTTPS (Application). A single page-load touches every layer of the TCP/IP suite โ and GATE can ask about each step.
Common misconception: "ICMP and ARP are Transport-layer protocols because they 'do not carry user data'." Wrong. ICMP and IGMP belong to the Internet (Network) layer, even though they ride on top of IP. ARP sits at the Link layer in most modern textbooks because it operates on MAC addresses within a single broadcast domain.
Another mistake is to mix up DNS uses UDP only. DNS uses UDP for small queries (the typical case) and TCP for zone transfers and responses larger than 512 bytes (or 4096 with EDNS0). GATE has set questions to test exactly this nuance.
A third confusion: DHCP uses TCP. No โ DHCP must use UDP because the client has no IP address at the moment of DHCPDISCOVER and cannot complete a TCP three-way handshake.
| Layer | Job | Representative Protocols |
|---|---|---|
| Application | Provide network services to user processes | HTTP(80), HTTPS(443), FTP(20/21), SMTP(25), DNS(53), DHCP(67/68), TELNET(23), SSH(22), POP3(110), IMAP(143), SNMP(161), TFTP(69) |
| Transport | End-to-end process communication | TCP (reliable), UDP (unreliable) |
| Internet (Network) | Routing of packets between networks | IP, ICMP, IGMP |
| Link | Frame delivery on a single link | Ethernet (802.3), Wi-Fi (802.11), PPP, Token Ring; ARP/RARP (at Link/Internet boundary) |
- โ- TCP/IP has four layers โ Link, Internet, Transport, Application โ from bottom to top.
- โ- Application layer protocols use well-known ports: HTTP(80), HTTPS(443), FTP(20/21), SMTP(25), DNS(53), TELNET(23), SSH(22), POP3(110), IMAP(143), SNMP(161), DHCP(67/68).
- โ- TCP is reliable and connection-oriented; UDP is unreliable and connectionless.
- โ- DNS and DHCP primarily use UDP; DNS also uses TCP for zone transfers.
- โ- HTTP, FTP, SMTP, POP3, IMAP, SSH, TELNET use TCP.
- โ- ICMP and IGMP are Internet-layer companions to IP and are encapsulated within IP datagrams.
- โ- ARP/RARP sit at the Link/Internet boundary; GATE typically treats ARP as Link layer.
- โ- Ethernet, Wi-Fi, PPP, Token Ring are Link-layer protocols.
For application-layer ports use "HTTP-80, HTTPS-443, FTP-21/20, SMTP-25, DNS-53, DHCP-67/68, POP3-110, IMAP-143, SSH-22, SNMP-161, TELNET-23, TFTP-69." A handy mnemonic: "H-80, S-443, F-21, M-25, D-53, P-110, I-143, S-22" โ read the first letters aloud in order. For "TCP vs UDP" remember "DNS, DHCP, TFTP, SNMP, RIP, NTP, RTP all UDP", almost everything else TCP.
- โ- Application layer holds HTTP/HTTPS/FTP/SMTP/DNS/DHCP/SSH/TELNET/POP3/IMAP/SNMP/TFTP.
- โ- Transport layer holds TCP (reliable) and UDP (unreliable).
- โ- Internet layer holds IP, ICMP and IGMP; ARP/RARP at the Link/Internet boundary.
- โ- Link layer holds Ethernet, Wi-Fi, PPP and Token Ring.
- โ- Memorise the port numbers and the TCP-vs-UDP usage โ they are guaranteed GATE marks.
TCP/IP Protocol Suite โ Flashcards
Cover the answer, recall, then check. 12 cards on the TCP/IP protocol suite for GATE CSE.
Q1. List the layers of the TCP/IP model.
A1. Application, Transport, Internet (Network), and Network Access/Link. Often expanded to 5 by splitting Link into Data Link + Physical.
Q2. How do the TCP/IP layers map onto OSI?
A2. TCP/IP Application = OSI Application+Presentation+Session; Transport = Transport; Internet = Network; Link = Data Link + Physical.
Q3. Which protocol is the core of the Internet layer, and what are its guarantees?
A3. IP โ connectionless, best-effort, unreliable, unordered delivery. Reliability, if needed, is added by the Transport layer (TCP).
Q4. Name the two Transport-layer protocols and their key contrast.
A4. TCP (connection-oriented, reliable, ordered, flow+congestion control) and UDP (connectionless, unreliable, low-overhead, no congestion control).
Q5. Which supporting protocols live at/around the Internet layer?
A5. ICMP (error/control messages), IGMP (multicast group management), ARP (IPโMAC), RARP (MACโIP).
Q6. ICMP messages are carried inside what?
A6. ICMP is encapsulated inside IP datagrams (protocol number 1), yet it is considered part of the Internet layer, not the Transport layer.
Q7. Which model came first, and which is a "reference" model only?
A7. TCP/IP protocols were implemented first (practical). OSI is a theoretical/reference model standardized later; TCP/IP has no separate Session/Presentation layers.
Q8. Give protocol number examples used in the IP header's Protocol field.
A8. ICMP = 1, IGMP = 2, TCP = 6, UDP = 17. The field tells the receiver which upper-layer protocol to demultiplex to.
Q9. Where does ARP sit in the TCP/IP stack (common GATE debate)?
A9. Between the Internet and Link layers โ it resolves a Layer-3 IP address to a Layer-2 MAC address, so it bridges the two.
Q10. Why is TCP/IP called an "hourglass" model?
A10. Many application/transport protocols above and many link technologies below, but everything narrows to a single Internet-layer protocol (IP) in the middle.
Q11. Name typical Application-layer protocols and their transport choice.
A11. HTTP/FTP/SMTP/TELNET โ TCP; DNS/DHCP/TFTP/SNMP/RIP โ UDP (DNS uses TCP for large/zone transfers).
Q12. Which addresses operate at Application, Transport, Internet, and Link layers?
A12. Application โ names/URLs; Transport โ port numbers (16-bit); Internet โ IP address (32-bit v4); Link โ MAC address (48-bit).
TCP/IP Protocol Suite โ Worked Example
Worked Example
Problem: Assign each protocol to its layer in the four-layer TCP/IP model: HTTP, TCP, UDP, IP, ARP, Ethernet. How does the TCP/IP model's layering compare with the 7-layer OSI model?
Solution:
The TCP/IP model has four layers: Application, Transport, Internet, and Network Access (Link).
Place each protocol:
- HTTP โ Application layer (handles web request/response semantics).
- TCP and UDP โ Transport layer (process-to-process delivery; TCP reliable, UDP best-effort).
- IP โ Internet layer (logical addressing and routing across networks).
- Ethernet โ Network Access / Link layer (framing and physical delivery on the local link).
- ARP โ resolves IP to MAC addresses; it bridges Internet and Link layers and is usually classified at the Link (Network Access) layer.
Comparison with OSI: the TCP/IP Application layer combines OSI's Application, Presentation, and Session layers; the TCP/IP Network Access layer combines OSI's Data Link and Physical layers. Transport and Internet map directly to OSI's Transport and Network layers.
Answer: HTTP โ Application; TCP, UDP โ Transport; IP โ Internet; ARP, Ethernet โ Network Access (Link). TCP/IP's 4 layers condense OSI's 7 (merging the top three and the bottom two).
- โ- TCP/IP layers (top-down): Application, Transport, Internet, Network Access โ a practical, protocol-driven model.
- โ- The Application layer of TCP/IP absorbs OSI's session/presentation/application; the Network Access layer absorbs OSI's data link/physical.
- โ- TCP gives reliable, connection-oriented delivery; UDP gives fast, connectionless best-effort delivery.