Introduction to Computer Networks: Layers, Topologies, Switching and Delay Formulas with Worked Examples

Build the Computer Networks foundation that later CN topics assume, including layer models, topology maths, switching choices and an end-to-end delay calculation.

KnowledgeGate Team

Exam prep & CS education

Updated 17 Aug 20266 min read

Computer Networks is easy to leave until late, but this chapter feeds almost every topic that follows. Layers, topologies, switching and delay formulas also sit behind the interview opener, “Explain OSI versus TCP/IP.” Get the vocabulary right once and the rest of the subject stops feeling like memorisation: a full mesh of six devices needs 15 links, an 8000-bit packet on a 1 Mbps link takes 8 ms to transmit however far it travels, and OSI's seven layers collapse into TCP/IP's four in exactly one way.

Computer Networks: what a network is and the four scales

A computer network connects end systems such as laptops, servers and phones through communication links and intermediate devices. Switches and routers move the exchanged data.

A protocol defines syntax, semantics and timing. Syntax is the message format, semantics is each field's meaning, and timing governs when data is sent and at what pace.

Scale

Physical scope

Typical ownership

Example technology

PAN

Personal metre-range

One user

Bluetooth

LAN

Room, building or campus

One organisation

Ethernet LAN

MAN

City

Provider or large organisation

Cable MAN

WAN

Country or continent

Multiple providers

Leased-line WAN

The internet is a network of networks joined by routers.

A topology describes how devices and links are arranged.

Topology

Links or cable for n devices

Main failure point

Typical use

Bus

1 backbone plus n drops

Backbone

Legacy shared-medium networks

Star

n links to a central device

Central hub or switch

Modern switched LANs

Ring

n links

One break in a single ring

Industrial networks

Full mesh

n(n - 1)/2 links

No central link

Reliable backbones

Hybrid

Depends on its parts

Inherits component weaknesses

Large networks

For six devices, a full mesh needs:

n(n - 1)/2 = 6(6 - 1)/2 = 6 × 5/2 = 15 links

Each mesh device needs n - 1 = 5 ports. A six-device star needs 6 links, a ring needs 6, and a bus uses 1 backbone with 6 drops. A failed star leaf-link isolates one device, while central-device failure affects all six. In a mesh question, write the general formula before substituting values.

OSI and TCP/IP: the two layer models

Layering divides communication into jobs with clear interfaces. OSI has seven layers, listed from the wire upward.

OSI layer

Main job

Protocol data unit and address

7. Application

User-facing network services

Data

6. Presentation

Translation, compression, encryption

Data

5. Session

Managing dialogues

Data

4. Transport

End-to-end process delivery

Segments, port

3. Network

Addressing and path selection

Packets, IP

2. Data Link

Framing and local delivery

Frames, MAC

1. Physical

Sending signals

Bits

TCP/IP groups OSI's top three layers into Application, keeps Transport, maps Network to Internet, and combines Data Link plus Physical as Network Access. A five-layer teaching model separates the bottom pair. Session and presentation duties remain inside applications and their libraries. OSI vs TCP/IP Model for GATE goes layer by layer through the mapping and the previous-year traps that pair a layer with the wrong data unit.

At Transport, study the service choices through TCP vs UDP: Transport Layer Explained. At the Network layer, IP Addressing and Subnetting Explained covers logical addresses, while Routing Algorithms: Distance Vector vs Link State explains how routers choose paths.

A ladder mapping the seven OSI layers to the four TCP/IP layers, with each OSI layer's protocol data unit labelled.

Switching: circuit, packet and message

Method

What is reserved or forwarded

Strength

Cost

Circuit switching

A dedicated end-to-end path after setup

Predictable rate for a steady flow

Setup time and idle reserved capacity

Packet switching

Individual packets, stored and forwarded at each hop

Statistical multiplexing suits bursty traffic

Variable queuing and per-packet handling

Message switching

The complete message at every hop

No dedicated circuit

Large storage need and long delay

Telephone networks illustrate circuit switching. The internet uses packet switching so bursty users can share links, with per-packet routing decisions. In historical message switching, a node receives the whole message before forwarding it. Circuit fits a long steady flow; packet fits traffic that starts and stops.

Network delay formulas: a fully worked example

Transmission delay pushes L bits onto a rate-R link: L/R. Propagation delay carries a bit over distance d at speed v: d/v. Queuing delay is buffer wait; processing delay covers header and error checks. Bandwidth is maximum bit rate, while throughput is the useful rate achieved.

Take a 1000 km link with propagation speed 2 × 10^8 m/s, bandwidth 1 Mbps, and one 1000-byte packet.

  1. Convert packet size: 1000 bytes × 8 = 8000 bits.

  2. Convert bandwidth: 1 Mbps = 10^6 bits/s.

  3. Transmission delay: L/R = 8000/10^6 s = 0.008 s = 8 ms.

  4. Convert distance: 1000 km = 10^6 m.

  5. Propagation delay: d/v = 10^6/(2 × 10^8) s = 0.005 s = 5 ms.

  6. Ignoring queuing and processing, total delay is 8 ms + 5 ms = 13 ms.

The sender finishes at t = 8 ms. The first bit arrives after 5 ms, and the last at t = 13 ms.

Bandwidth-delay product uses propagation delay: 10^6 bits/s × 0.005 s = 5000 bits. That is 625 bytes, or 5000/8000 = 0.625 packet, well under one 8000-bit packet.

A timeline of an 8000-bit packet on a 1000 km, 1 Mbps link: 8 ms to transmit, 5 ms to propagate, last bit at 13 ms.

Computer Networks traps students fall into

Do not swap transmission and propagation. The first depends on packet size and link rate; the second depends on distance and signal speed. Here they contribute separate 8 ms and 5 ms delays.

A hub repeats bits in one collision domain. A switch creates one collision domain per port, but normally keeps one broadcast domain unless VLANs divide it. A router separates broadcast domains and forwards by IP address.

Do not memorise OSI names without data units and addresses. Questions pair layers with frames, packets, segments, MAC, IP or ports. Also, TCP/IP is not merely “OSI with fewer names”. Session and presentation duties move into Application rather than vanishing.

GATE and interview questions on Introduction to CN

GATE tests layer, data-unit and device recall, plus mesh link counts or L/R and d/v numericals. Recent GATE information brochures have specified the syllabus, pattern and marks split, so check the official GATE 2026 website run by IIT Guwahati rather than carrying an old figure into another cycle.

Try one in exam form: a 100-byte packet crosses a 500 km link at 10 Mbps, with signal speed 2 × 10^8 m/s. Which delay dominates? Transmission is 800/10^7 s = 0.08 ms and propagation is 5 × 10^5/(2 × 10^8) s = 2.5 ms, so propagation is more than thirty times larger and the total is 2.58 ms. The answer flips from the earlier example: shrink the packet and raise the rate, and distance takes over.

Interviews ask OSI versus TCP/IP, hub versus switch versus router, or what happens at each layer when a page loads. For that last one the expected trace is short: DNS resolves the hostname and HTTP forms the request at Application, TCP opens the connection and adds ports at Transport, IP chooses the route at Network, each hop frames the packet with MAC addresses at Data Link, and Physical puts the bits on the wire. They can then drill into TCP, IP addressing or routing.

Use GATE Test Series, Mocks and Topic-wise Tests for timed practice. CS Fundamentals for Placements by Sanchit Sir places CN beside other interview subjects.

The short version and next step

  • A network joins end systems, links and intermediate devices under protocols that define syntax, semantics and timing.

  • A full mesh needs n(n - 1)/2 links, so six devices need 15.

  • OSI has seven layers; four-layer TCP/IP combines the top three and the bottom two.

  • Circuit switching reserves a path, while packet switching shares capacity among bursty flows.

  • L/R gives transmission delay and d/v gives propagation delay. Here they are 8 ms and 5 ms, for 13 ms total.

Next, work through the four lessons linked above on OSI versus TCP/IP, transport services, IP addressing and routing, or take the whole route through the GATE CS Exam Preparation hub. Then solve timed CN tests and explain every answer in layer, address and delay terms.