Skip to content
Topic guide · Networking

OSI and TCP/IP Models: the Layers, Their Jobs and Devices · ওএসআই ও টিসিপি/আইপি মডেল: স্তর, কাজ ও ডিভাইস

The OSI model divides network communication into 7 layers, from bottom to top: Physical, Data Link, Network, Transport, Session, Presentation and Application. The TCP/IP model that the Internet actually uses has 4 layers: Link (Network Access), Internet, Transport and Application, where its Application layer covers the top three OSI layers. Each layer serves the one above it; for example, routers work at the Network layer using IP addresses, and switches at the Data Link layer using MAC addresses.

ওএসআই মডেল নেটওয়ার্ক যোগাযোগকে নিচ থেকে ওপরে ৭টি স্তরে ভাগ করে: ফিজিক্যাল, ডেটা লিংক, নেটওয়ার্ক, ট্রান্সপোর্ট, সেশন, প্রেজেন্টেশন ও অ্যাপ্লিকেশন। ইন্টারনেট যে টিসিপি/আইপি মডেল ব্যবহার করে তার স্তর ৪টি: লিংক (নেটওয়ার্ক অ্যাক্সেস), ইন্টারনেট, ট্রান্সপোর্ট ও অ্যাপ্লিকেশন; এর অ্যাপ্লিকেশন স্তর ওএসআই-এর ওপরের তিন স্তরের কাজ করে। প্রতিটি স্তর তার ওপরের স্তরকে সেবা দেয়; যেমন রাউটার আইপি অ্যাড্রেস দিয়ে নেটওয়ার্ক স্তরে এবং সুইচ ম্যাক অ্যাড্রেস দিয়ে ডেটা লিংক স্তরে কাজ করে।

Asked in past exams
126
Papers
101

1. Why networks are layered

Sending a message across the world involves many separate problems: turning bits into signals, moving a frame to the next device, finding a route across many networks, delivering data reliably to the right program, and presenting it in a form the program understands. A layered model gives each problem to one layer. Each layer uses the services of the layer below and offers services to the layer above, so one layer can change (Wi-Fi instead of cable, say) without changing the others.

Two models matter:

  • OSI (Open Systems Interconnection), a 7-layer reference model published by ISO (ISO/IEC 7498-1). It is mainly a teaching and design reference.
  • TCP/IP, the 4-layer model the Internet is actually built on (described in RFC 1122).

2. The seven OSI layers

Learn them from the bottom (layer 1) with a memory aid: Please Do Not Throw Sausage Pizza Away.

# Layer Main job Data unit (PDU) Address used Typical devices Example protocols
7 Application Network services for applications Data (message) – Gateway (works across layers; usually listed at layer 7) HTTP, FTP, SMTP, DNS
6 Presentation Translation, encryption, compression Data (message) – – (formats such as JPEG, ASCII; TLS is often placed here or in 5–7)
5 Session Opening, managing and closing sessions (dialog control) Data (message) – – RPC, NetBIOS
4 Transport End-to-end delivery, ports, reliability, flow control Segment (TCP) / Datagram (UDP) Port number – TCP, UDP
3 Network Logical addressing and routing between networks Packet IP address Router, layer-3 switch IP, ICMP
2 Data Link Framing, MAC addressing, error detection on one link Frame MAC address Switch, bridge, NIC Ethernet, PPP, Wi-Fi (802.11) MAC
1 Physical Bits as signals on the medium Bit – Hub, repeater, cable, modem RS-232, 802.3 physical layers

Two neighbouring facts exams like to ask:

  • ARP maps an IP address (layer 3) to a MAC address (layer 2), so it sits between the two, and books disagree on its layer: Forouzan lists it with the network-layer protocols (IP, ICMP, IGMP, ARP), RFC 1122 describes it under the Link layer, and some call it "layer 2.5". In MCQs, "Network layer" is the usual keyed answer when it is an option.
  • The Data Link layer has two sublayers (IEEE 802): LLC (Logical Link Control, the upper one) and MAC (Media Access Control, the lower one).
  • A hub repeats bits to every port (layer 1), a switch forwards frames by MAC address (layer 2), a router forwards packets by IP address (layer 3).

3. The TCP/IP model and how it maps to OSI

TCP/IP layer Covers OSI layers What it does Protocols
Application 7, 6, 5 Everything an application needs HTTP, HTTPS, DNS, FTP, SMTP, SSH, DHCP
Transport 4 Process-to-process delivery TCP (reliable, connection-oriented), UDP (fast, connectionless)
Internet 3 Addressing and routing across networks IP (IPv4, IPv6), ICMP
Link (Network Access) 2, 1 Delivery on the local link and the physical medium Ethernet, Wi-Fi, PPP

Some textbooks split the Link layer into Data Link and Physical and teach a 5-layer "hybrid" model. The older US Department of Defense (DoD) names are Process/Application, Host-to-Host (= Transport), Internet and Network Access. All three counts appear in exams, so read the question: "OSI" means 7, "TCP/IP" means 4 (or 5 if the options say so).

4. Encapsulation: what happens to your data

On the way down, each layer adds its own header (the Data Link layer also adds a trailer); on the way up, each layer removes it. This is encapsulation and decapsulation.

Going down the layers, the data gets a TCP header (segment), an IP header (packet) and an Ethernet header and trailer (frame), and leaves as bits.

Worked example: opening a web page. You type a site name in the browser.

  1. Application: DNS turns the name into an IP address, then the browser builds an HTTP (or HTTPS) request.
  2. Transport: TCP connects to port 443 (HTTPS) or 80 (HTTP) with a three-way handshake (SYN, SYN-ACK, ACK) and splits the data into segments; the sequence number counts bytes (every byte is numbered), not segments.
  3. Network: IP adds the source and destination IP addresses; routers along the path read only this header to forward the packet.
  4. Data Link: Ethernet or Wi-Fi adds the MAC address of the next hop (usually your router, the default gateway), found with ARP.
  5. Physical: the frame leaves as electrical, optical or radio signals.

At the server the layers run in reverse, each removing its header and passing the rest upward.

5. Common ports worth knowing

Port Protocol Transport
20, 21 FTP (data, control) TCP
22 SSH TCP
23 Telnet TCP
25 SMTP TCP
53 DNS UDP (and TCP)
67, 68 DHCP (server, client) UDP
80 HTTP TCP
110 POP3 TCP
143 IMAP TCP
443 HTTPS TCP

6. OSI and TCP/IP compared

Point OSI TCP/IP
Layers 7 4
Origin ISO reference model (1984; revised 1994) Built from the protocols of ARPANET and the Internet
Use Teaching and design reference The model the Internet actually runs on
Session and presentation Separate layers Inside the Application layer
Protocol fit Model came first, protocols later Protocols came first, model described them

Practice · অনুশীলন

  1. At which OSI layer does a router work, and which address does it use?
    Answer

    The Network layer (layer 3), using IP addresses.

  2. What is the data unit at the Transport layer called?
    Answer

    A segment for TCP (a datagram for UDP).

  3. Which OSI layer handles encryption, compression and translation of data formats?
    Answer

    The Presentation layer (layer 6).

  4. Which TCP/IP layer corresponds to the OSI Session, Presentation and Application layers?
    Answer

    The Application layer.

  5. A device forwards frames using MAC addresses. What is it, and at which layer?
    Answer

    A switch (or bridge), at the Data Link layer (layer 2).

Asked in past exams · আগের পরীক্ষায় যেভাবে এসেছে

Our past papers have 126 questions on this topic (36 MCQ, 90 written) from 101 exams. Here are 12 of them; each links to its full paper.

  1. What is the port number used by DNS?

    Model answer on the paper page

  2. Which device operates at Layer 2 of OSI?

    • a)Router
    • b)Switch (correct answer)
    • c)Hub
    • d)Modem
    Explanation · ব্যাখ্যা

    Correct answer: (b) Switch

    Layer 2 of the OSI model is the data link layer, which deals with frames and MAC addresses. A (basic) switch reads the destination MAC address of each frame, looks it up in its MAC address (CAM) table and sends the frame only out of the matching port. That makes it the classic Layer 2 device, together with the bridge.

    Why the other options are wrong

    • (a) Router: Works at Layer 3 (network layer) and forwards packets by IP address.
    • (c) Hub: Works at Layer 1 (physical layer); it repeats electrical signals to all ports without reading any address.
    • (d) Modem: Converts between digital data and analog signals on the line, a physical-layer function.

    Tip: Hub = L1, switch/bridge = L2 (MAC), router = L3 (IP). A "Layer 3 switch" is a switch with routing added.

    Sources: Troubleshoot LAN Switching Environments - Cisco; RFC 1812: Requirements for IP Version 4 Routers

  3. (a) Define HTTP and DNS. Suppose that mygov.bd is a domain name. How does this DNS work?

    Model answer on the paper page

  4. What is the TCP/IP Model?

    Model answer on the paper page

  5. What is the difference between DOD and OSI model?

    Model answer on the paper page

  6. Bridges are used at ________ layer.

    • a)Physical layer
    • b)MAC layer (correct answer)
    • c)Network layer
    • d)Transport layer
    Explanation · ব্যাখ্যা

    Correct answer: (b) MAC layer

    A bridge works at the Data Link layer, and more precisely in its MAC (Media Access Control) sublayer. The IEEE standard for bridges, 802.1D, is titled "MAC Bridges": it joins LANs below the MAC service boundary and relays frames by reading their MAC addresses, which is why bridged LANs look like one network to the LLC and network-layer protocols above.

    Why the other options are wrong

    • (a) Physical layer: Physical-layer devices (repeaters, hubs) only regenerate bits and never read addresses.
    • (c) Network layer: Forwarding by IP (logical) address at the network layer is a router's job.
    • (d) Transport layer: Transport-layer functions (ports, end-to-end reliability) run in the end hosts, not in a bridge.

    Tip: Data Link = LLC + MAC sublayers; bridges and switches live in the MAC sublayer.

    Source: IEEE 802.1D-2004: Media Access Control (MAC) Bridges

  7. What is TCP/IP model? Briefly explain TCP/IP model.

    Model answer on the paper page

  8. What is network protocol? Describe TCP/IP protocol in computer network?

    Model answer on the paper page

  9. What is piggybacking in Networking? Difference among Hub, Switch and Router.

    Model answer on the paper page

  10. What is the difference between TCP and UDP?

    Model answer on the paper page

  11. What is OSI model? Which layers are important for data transfer and user interaction?

    Model answer on the paper page

  12. Email is a protocol of the following layer-

    • a)Physical layer
    • b)Data Link Layer
    • c)Application layer (correct answer)
    • d)TCP layer
    Explanation · ব্যাখ্যা

    Correct answer: (c) Application layer

    Strictly, e-mail is a service rather than a single protocol; the protocols that carry it are SMTP (sending and relaying), POP3 and IMAP (retrieving). All of them are application-layer protocols: they define the commands and messages that mail programs exchange, and they hand their data to the transport layer (TCP) below them. In both the OSI and TCP/IP models, user-facing services such as e-mail, web (HTTP), file transfer (FTP) and DNS sit in the Application layer.

    Why the other options are wrong

    • (a) Physical layer: Deals only with sending raw bits as electrical, optical or radio signals over the medium.
    • (b) Data Link Layer: Frames data and uses MAC addresses for delivery between neighbouring nodes on one link (e.g. Ethernet); it knows nothing about mailboxes or messages.
    • (d) TCP layer: Not a formal layer name; TCP belongs to the Transport layer, which carries the mail protocols' data reliably but does not define e-mail itself.

    Tip: If a protocol is named after a user service (mail, web, file transfer, names), it is an Application-layer protocol.

    Source: RFC 1123: Requirements for Internet Hosts - Application and Support

Common mistakes · সাধারণ ভুল

  • Listing the layers top-down when the question asks for layer numbers: layer 1 is Physical, layer 7 is Application.
  • Mixing up the data units: bits (1), frames (2), packets (3), segments (4).
  • Saying TCP/IP has 7 layers: it has 4 (5 in the hybrid textbook model).
  • Putting a hub at layer 2 or a switch at layer 3: hub = 1, switch = 2, router = 3 (a layer-3 switch also routes).
  • Confusing MAC addresses (layer 2, local link) with IP addresses (layer 3, end to end).

বাংলায় সংক্ষেপে

  • ওএসআই মডেলের ৭টি স্তর (নিচ থেকে): ফিজিক্যাল, ডেটা লিংক, নেটওয়ার্ক, ট্রান্সপোর্ট, সেশন, প্রেজেন্টেশন, অ্যাপ্লিকেশন।
  • টিসিপি/আইপি মডেলের ৪টি স্তর: লিংক, ইন্টারনেট, ট্রান্সপোর্ট, অ্যাপ্লিকেশন।
  • ডেটার একক: ফিজিক্যালে বিট, ডেটা লিংকে ফ্রেম, নেটওয়ার্কে প্যাকেট, ট্রান্সপোর্টে সেগমেন্ট।
  • ডিভাইস: হাব ও রিপিটার ফিজিক্যাল স্তরে, সুইচ ও ব্রিজ ডেটা লিংক স্তরে, রাউটার নেটওয়ার্ক স্তরে।
  • এনক্যাপসুলেশন: নিচে নামার সময় প্রতিটি স্তর হেডার যোগ করে, ওপরে ওঠার সময় তা সরিয়ে ফেলে।
  • সুপরিচিত (well-known) পোর্ট: এইচটিটিপি ৮০, এইচটিটিপিএস ৪৪৩, ডিএনএস ৫৩, এফটিপি ২০/২১, এসএমটিপি ২৫।

Updated 2026-10-18. Written by ARBS Academy; the past exam questions are from public recruitment exams.