Chapter 01 · CN
Reference Models & Network Layers
4 topics · 1 sections · beginner-friendly study notes · Updated
Layered models split networking into manageable pieces.
This chapter covers the seven OSI layers, the TCP/IP model (4 or 5 layers), how encapsulation adds headers on the way down, and which device operates at which layer.
Every networking exam starts with layers.
Knowing the PDU, address type and device at each layer answers a large share of GATE and CCNA questions directly.
Troubleshooting (is it a cable, MAC, IP, port or application problem?
), designing networks and reading packet captures in Wireshark.
Network Topologies
A network topology is the arrangement of nodes and links. Physical topology describes the actual cabling; logical topology describes how data flows. Basic types: bus, ring, star, mesh (full and partial), tree and hybrid.
In short: The shape of the network: a shared line, a circle, a hub-and-spokes, or everyone connected to everyone.
Think about it
Link-count and fault-tolerance questions are standard in GATE and semester exams, and topology decides cost, reliability and which MAC protocol is used.
Bus: all nodes share one backbone cable with terminators; cheap, but a cable break stops the network and collisions need CSMA/CD; links = 1 backbone.
Ring: each node connects to exactly two neighbours; data circulates (token ring/FDDI); one break stops a single ring unless a dual ring is used; links = n.
Star: every node connects to a central hub/switch; easy to add nodes and isolate faults but the centre is a single point of failure; links = n.
Full mesh: every pair of nodes has a dedicated link; links = n(n−1)/2, each node needs n−1 ports; very reliable and fast, very costly.
Partial mesh keeps selected links.
Tree: hierarchy of stars on a backbone bus; Hybrid: combination.
Comparison
cabling cost (mesh highest, bus lowest), fault tolerance (mesh best, bus/ring worst), scalability (star/tree best), troubleshooting (star easiest).
Modern Ethernet LANs are physically star (switch) even when logically bus (hub).
Counting: for n devices, star needs n cables, ring needs n cables, bus needs 1 backbone plus n drop lines, full mesh needs n(n−1)/2 cables and n−1 NICs per device.
Key points
- Physical vs logical topology: Actual cable layout vs the path data signals take.
- Full mesh: Every node directly connected to every other node.
- Single point of failure: Component whose failure breaks the whole network (star hub, bus backbone).
- Full mesh with n = 8 nodes: links = 8×7/2 = 28; ports per node = 7.
- Star with n = 8 hosts: 8 links; failure of one host link affects only that host, failure of the hub affects all.
- Topology vs reliability: mesh > star/tree > ring > bus.
Read more
OSI 7-Layer Model vs TCP/IP
The OSI model divides communication into seven layers from top to bottom: Application (7), Presentation (6), Session (5), Transport (4), Network (3), Data Link (2), Physical (1). Each layer offers services to the layer above and uses services of the layer below.
In short: Think of posting a parcel: write the letter (application), package it (presentation), arrange the dialogue (session), choose end-to-end delivery (transport), route through cities (network), hand to the next truck (data link), and the physical road.
Think about it
A common vocabulary lets vendors build interoperable products and lets engineers isolate faults by layer.
Physical: transmits raw bits over a medium (voltage, cables, hubs).
Data Link: node-to-node delivery within one link, framing, MAC addressing, error detection, access control.
Network: host-to-host delivery across networks, logical (IP) addressing and routing.
Transport: process-to-process delivery, ports, segmentation, reliability, flow and congestion control.
Session: dialog control, checkpoints, synchronization.
Presentation: translation, encryption and compression.
Application: network services to user programs (HTTP, SMTP, FTP, DNS).
Mnemonic bottom-up: Please Do Not Throw Sausage Pizza Away.
Protocol Data Units: bits (L1), frame (L2), packet/datagram (L3), segment (TCP) or datagram (UDP) (L4), data/message (L5-7).
Key points
- PDU: Protocol data unit: the unit of data at a layer (frame, packet, segment).
- Service access point: Interface where a layer gives services to the layer above.
- Peer protocol: Logical communication between the same layer on two hosts.
- OSI vs TCP/IP: OSI has 7 layers, TCP/IP has 4 (or 5); OSI separates Presentation and Session, TCP/IP folds them into Application; OSI was designed before the protocols (protocol-independent, strict layers), TCP/IP was designed around working protocols; OSI Network layer supports connection-oriented and connectionless service while TCP/IP Internet layer is connectionless only (Transport supports both: TCP and UDP).
- Mapping: OSI 7,6,5
→TCP/IP Application; OSI 4→Transport; OSI 3→Internet; OSI 2,1→Network Access. - Address used: L2 = MAC (physical), L3 = IP (logical), L4 = port number.
- OSI is a reference model (never fully implemented); TCP/IP is the protocol suite actually used.
TCP/IP Protocol Architecture
The TCP/IP model has four layers: Application, Transport, Internet and Network Access (Link). A five-layer teaching version splits the last into Data Link and Physical.
In short: A shorter map of the same journey, built around the protocols the Internet really uses.
Think about it
Real network programming, configuration and troubleshooting use TCP/IP concepts.
Mapping: OSI Application + Presentation + Session → TCP/IP Application; OSI Transport → Transport (TCP, UDP); OSI Network → Internet (IP, ICMP, ARP sits between L2 and L3); OSI Data Link + Physical → Network Access (Ethernet, Wi-Fi).
Key differences from OSI: TCP/IP merges the top three layers, grew from working protocols rather than a theoretical design, and is connectionless at the internet layer with a choice of connection-oriented (TCP) or connectionless (UDP) transport, while OSI Network layer supports both modes and Transport is connection-oriented.
IP delivers best-effort (no guarantee of delivery, order or duplication protection).
Key points
- Internet layer: Logical addressing and routing (IP).
- Best effort: Network tries to deliver but gives no guarantee.
- Protocol stack: Set of protocols working together at each layer.
- Common protocols by layer: App = HTTP, FTP, SMTP, DNS, DHCP; Transport = TCP, UDP; Internet = IP, ICMP, IGMP; Link = Ethernet, PPP, Wi-Fi.
PDU Encapsulation
Encapsulation is the process in which each layer on the sender adds its own header (and sometimes a trailer) around the data received from the layer above. The receiver performs decapsulation, removing headers layer by layer.
In short: Each layer puts the message in a new envelope with its own address label; the receiver opens the envelopes one by one.
Application data → Transport adds header (ports, sequence numbers) giving a segment → Network adds IP header giving a packet → Data Link adds header (MAC) and trailer (FCS) giving a frame → Physical sends bits.
Typical sizes: TCP header 20 bytes minimum, UDP header 8 bytes, IPv4 header 20 bytes minimum, Ethernet header 14 bytes plus 4-byte FCS.
Overhead reduces efficiency: efficiency = payload / total bytes sent.
Routers decapsulate to layer 3 and re-encapsulate with a new L2 header at each hop while the IP addresses stay the same (except with NAT); MAC addresses change hop by hop.
Key points
- Header / trailer: Control information placed before / after the payload.
- Payload: Data carried inside the PDU of a layer.
- MTU: Maximum transmission unit: largest payload a link layer frame can carry (1500 bytes for Ethernet).
- End-to-end: source and destination IP stay constant; source and destination MAC change at every hop.
Read more
Network devices by layer
Hubs and repeaters work at the Physical layer, bridges and switches at the Data Link layer, routers at the Network layer, and gateways, proxies and application firewalls at higher layers.
In short: Hub repeats bits, switch forwards frames by MAC, router forwards packets by IP.
Think about it
Device roles decide the collision and broadcast domain counts, a staple numerical.
Repeater/hub: regenerates signals; a hub is a multi-port repeater and creates one collision domain and one broadcast domain.
Bridge/switch: learns MAC addresses, forwards only to the correct port; each switch port is its own collision domain, but all ports are in one broadcast domain (unless VLANs are used).
Router: connects different networks, separates broadcast domains (each interface is its own broadcast domain and collision domain), uses IP routing tables.
Layer-3 switch: switching plus routing.
Gateway: translates between different protocol stacks.
Domain counting rule: collision domains = number of switch ports (or hub segments) plus router interfaces; broadcast domains = number of router interfaces (VLANs separate switch domains).
Key points
- Collision domain: Segment where simultaneous transmissions collide.
- Broadcast domain: Set of nodes that receive a broadcast frame.
- VLAN: Logical grouping that splits a switch into separate broadcast domains.
- Hub: L1, 1 collision domain. Switch: L2, collision domain per port. Router: L3, separates broadcast domains.
Solved examples
An application sends 1000 bytes of data over TCP/IPv4 on Ethernet (headers: TCP 20, IP 20, Ethernet header 14 + trailer 4). Find the frame size and the efficiency.
- Payload = 1000 bytes
- TCP 20, IP 20, Ethernet header 14, FCS 4
Total bytes on the wire and efficiency
Formula Applied:—Approach note: Add headers layer by layer, from transport down to data link.
One router has 3 interfaces, each connected to a separate switch. Every switch connects 4 hosts plus its uplink to the router (5 used ports per switch). Count the collision domains and broadcast domains.
- 3 router interfaces, one per LAN
- Each switch: 4 host ports + 1 uplink port
Collision domains and broadcast domains
Formula Applied:—Approach note: Collision domains are counted per switch port/link; broadcast domains per router interface (or VLAN).
Match: (1) end-to-end reliability (2) routing (3) MAC addressing (4) HTTP. To which OSI layers?
Four layer names
Formula Applied:—Approach note: Remember: Application messages, Transport segments, Network packets, Data-link frames.
A 1500-byte IP packet crosses 3 routers (4 hops). Ignoring extras, how many times is the IP header examined by forwarding devices, and how many times is the Ethernet header rewritten?
Counts
Formula Applied:—Approach note: IP is end-to-end addressing; MAC is hop-by-hop.
Real-world applications
Using Reference Models & Network Layers in real projects
Troubleshooting (is it a cable, MAC, IP, port or application problem?), designing networks and reading packet captures in Wireshark.
Common mistakes
❌ Myth: A switch breaks broadcast domains.
Why this is wrong: A switch forwards broadcast frames out of all ports, so all hosts stay in the same domain.
✅ Verified Truth: Switches break collision domains; routers (or VLANs) break broadcast domains.
⚠️ Exam Tip: Memorise: switch = more collision domains, router = more broadcast domains.
❌ Myth: MAC and IP addresses both remain unchanged from source to destination.
Why this is wrong: The MAC address is link-local and is replaced at every hop; the IP address stays end to end.
✅ Verified Truth: IP is end to end; MAC is hop to hop.
⚠️ Exam Tip: Draw two routers and show MAC rewriting.
❌ Myth: OSI is the model the Internet runs on.
Why this is wrong: The Internet uses the TCP/IP suite; OSI is mainly a reference and teaching model.
✅ Verified Truth: OSI = reference; TCP/IP = implemented.
⚠️ Exam Tip: Mention both when asked to compare.
Revision notes
Layered models split networking into manageable pieces. This chapter covers the seven OSI layers, the TCP/IP model (4 or 5 layers), how encapsulation adds headers on the way down, and which device operates at which layer.
High-Yield Quick Revision Points
- OSI bottom-up: Physical, Data Link, Network, Transport, Session, Presentation, Application
- PDUs: bit, frame, packet, segment/datagram, data
- Address types: MAC (L2), IP (L3), port (L4)
- TCP/IP: Application, Transport, Internet, Network Access
- Hub L1, switch L2, router L3
- MAC changes per hop; IP is end to end
Practice questions
Which OSI layer is responsible for process-to-process delivery?
A router operates at which layer?
The PDU at the Data Link layer is called a:
Which layer handles encryption and compression in the OSI model?
How many broadcast domains are there if a single router with 4 active interfaces connects four switched LANs?