PadhaikoAll subjects

Introduction

Computer Networks (ENCT 304)

Open in the Padhaiko app

1.1 Computer network, importance and applications

Definition

Computer Network

A computer network is an interconnected collection of autonomous computing devices (such as personal computers, servers, smartphones, network switches, and routers) capable of exchanging data and sharing hardware or software resources using established communication protocols over transmission media.

Importance of Computer Networks

Modern computing infrastructures rely critically on computer networks for several fundamental operational capabilities:

  1. Resource Sharing: High-cost hardware peripherals (such as high-speed laser printers, storage area networks, and compute clusters) and software resources (such as enterprise database management systems) are shared seamlessly among thousands of concurrent users.
  2. Reliability and Redundancy: By replicating files, databases, and critical services across geographically dispersed servers, a hardware failure at one host does not paralyze the entire enterprise; traffic is dynamically rerouted to operational nodes.
  3. High Communication Speed and Reduced Cost: Real-time data exchange via electronic mail, instant messaging, and collaborative development tools replaces costly physical transportation of paper records and media.
  4. Centralized Data Management: Data integrity, regular automated backups, and unified security policies (such as role-based access control and encryption) can be enforced centrally from dedicated data centers.
  5. Distributed Processing and Scalability: Large computational tasks (such as climate modeling, rendering, or big-data analytics) are partitioned into subproblems solved concurrently across networked workstations.

Broad Applications of Computer Networks

Prominent Applications of Computer Networks
Sector / DomainKey Network ApplicationPrimary Protocols / Technologies
Business & EnterpriseEnterprise Resource Planning (ERP), Cloud Computing, Virtual Private Networks (VPN), Distributed DatabasesIPsec, TLS/SSL, SQL/ODBC, RPC, NFS
Financial ServicesOnline Banking, Automated Teller Machines (ATM), High-frequency Trading, Electronic Funds TransferISO 8583, FIX protocol, HTTPS, Dedicated Leased Lines
Mobile & TelecommunicationVoice over IP (VoIP), Video Conferencing, Cellular Data NetworksSIP, RTP/RTCP, H.323, 4G LTE/5G NR
Consumer ServicesWorld Wide Web, Video Streaming, E-Commerce, Social NetworkingHTTP/3, QUIC, MPEG-DASH, CDN, DNS
Industrial & IoTSupervisory Control and Data Acquisition (SCADA), Smart Grids, Environmental Sensor TelemetryMQTT, CoAP, Modbus TCP, IEEE 802.15.4

1.2 Types of computer networks

Computer networks are primarily classified according to their geographical span, organizational ownership, and physical scale:

AspectPAN and LANMAN and WAN
Geographic SpanPAN: ; LAN: single room, office, or campus ()MAN: entire city (); WAN: country, continent, or the globe
Data Rate (Bandwidth)Very high ( to or higher)Moderate to high ( to , constrained by long-haul fiber costs)
Propagation DelayVery low (typically under )High ( to over across transoceanic fiber or satellite links)
Error RateVery low due to short, controlled cablingHigher due to diverse atmospheric, terrestrial, and repeater conditions
OwnershipPrivate (individual or single enterprise)Often public/consortium (telecom operators, ISPs, backbone carriers)
Standard TechnologiesBluetooth, Zigbee, IEEE 802.3 (Ethernet), IEEE 802.11 (Wi-Fi)Carrier Ethernet, MPLS, DWDM optical backbones, SONET/SDH, 5G backhaul

Categorized Network Classifications

  1. Personal Area Network (PAN): Spans the immediate workspace of an individual (radius ). Typical wireless PAN (WPAN) technologies include Bluetooth (IEEE 802.15.1) and Zigbee (IEEE 802.15.4) interconnecting laptops, smartwatches, and wireless earphones.
  2. Local Area Network (LAN): Confined to a geographically restricted area such as an office suite, university laboratory, or campus building. LANs typically use Ethernet over twisted-pair copper cabling or IEEE 802.11 Wi-Fi.
  3. Metropolitan Area Network (MAN): Spans an entire municipality or urban district. Common examples include cable television distribution networks, city-wide municipal Wi-Fi, and optical fiber rings interconnecting bank branches across Kathmandu Valley.
  4. Wide Area Network (WAN): Spans expansive geographical boundaries across nations or continents. WANs utilize public transmission facilities, undersea optical cables, and microwave/satellite links. The global Internet is the largest and most well-known public WAN.
  5. Wireless Local Area Network (WLAN): A LAN implementation utilizing radio frequency (RF) links rather than guided copper/fiber cables, standardized under the IEEE 802.11 family.
  6. Storage Area Network (SAN): A high-speed, specialized, dedicated sub-network that connects shared pools of storage devices (disk arrays, tape libraries) to enterprise servers using Fibre Channel (FC) or iSCSI.

1.3 Network topologies

Definition

Network Topology

The topology of a network defines how the nodes (hosts, routers, switches) are logically or physically interconnected by communication links. Physical topology refers to the actual geometric layout of cables and devices, whereas logical topology defines how data frames flow through the network.

Primary Network Topologies

  1. Mesh Topology:
    • In a fully connected mesh topology, every single node has a dedicated point-to-point link to every other node in the network.
    • For a network containing nodes, the total number of duplex physical communication links required is:
  1. Star Topology:
    • Every node connects via a dedicated point-to-point link directly to a central networking device—typically a multiport switch or hub. Nodes do not communicate directly with one another.
    • A star network with peripheral nodes requires exactly links and device ports, plus an -port central hub/switch.
    • Advantages: Easy installation and reconfiguration; if a peripheral cable breaks, only that single node is isolated while the rest of the network remains fully operational.
    • Disadvantages: The central device represents a single point of failure (SPOF); if the central switch fails, the entire network goes down.
  2. Bus Topology:
    • A multipoint topology where all devices share a single linear central transmission medium (the "backbone" cable). Both ends of the bus must be capped with terminating resistors (terminators) to absorb signals and prevent reflections.
    • Advantages: Minimal cabling required; simple and inexpensive to set up for small, temporary LANs (e.g., traditional 10BASE2 thin Ethernet).
    • Disadvantages: Heavy packet collisions under traffic; a break or fault in the backbone cable brings down the entire network; difficult fault isolation.
  3. Ring Topology:
    • Each device has a dedicated point-to-point connection to exactly two immediate neighboring devices, forming a continuous unidirectional or bidirectional closed loop.
    • A signal circulates around the ring from device to device (often controlled by a token, as in IEEE 802.5 Token Ring) until it reaches the intended destination.
    • Advantages: Equal channel access opportunity for all nodes without collisions; straightforward performance modeling.
    • Disadvantages: A break anywhere in a unidirectional ring disables the whole network; adding or removing nodes requires momentarily breaking the physical ring.
  4. Tree Topology:
    • A hierarchical arrangement where groups of star-configured networks are connected to a linear bus or higher-level root switch.
    • Allows straightforward branch expansion and departmental network segmentation.
  5. Hybrid Topology:
    • A combination of two or more distinct topologies (e.g., Star-Bus or Star-Ring) deployed to leverage the benefits of each in enterprise environments.
Quantitative Comparison of Physical Network Topologies
TopologyRequired Links for NodesHardware Ports per NodeFault ToleranceCabling Cost
Full MeshOutstanding (multiple redundant paths)Extremely High
Star (plus on central switch)High (isolated host failure; SPOF at switch)Moderate
Bus backbone ( drop lines) (via drop tap)Very Low (backbone break halts network)Very Low
Ring (Rx and Tx ports)Low (unidirectional) / Moderate (dual-ring)Low to Moderate
TreeVariable ( for leaves, multiple for hubs)Moderate (branch failure isolated to subtree)Moderate

1.4 Client/server and P2P networks

Networks are architected logically based on how control, storage, and processing tasks are allocated among participating hosts:

AspectClient/Server ArchitecturePeer-to-Peer (P2P) Architecture
Role DifferentiationAsymmetric roles: Clients request services; dedicated Servers listen, process, and respondSymmetric roles: Every node (peer) acts simultaneously as both client (servent) and server
CentralizationCentralized control, administration, security authentication, and data repositoriesDecentralized; no central controller or master coordinator
ScalabilityServer can become a performance bottleneck under heavy loads (requires load balancers)Highly scalable; aggregate bandwidth and compute power grow as more peers join
Data Backup & SecurityStraightforward; scheduled centralized backup and unified access control on serversComplex; files are fragmented and scattered over dynamic, unvetted participant machines
Implementation CostHigh initial investment for specialized server hardware, OS licenses, and rack hostingInexpensive; operates over commodity client hardware and ordinary residential connections
Prominent ExamplesWeb browsing (HTTP/HTTPS), Email (SMTP/IMAP), Database systems (PostgreSQL, Oracle)BitTorrent, Gnutella, IPFS, Bitcoin / Ethereum blockchain networks

Hybrid Architectures

Modern Internet systems frequently combine both paradigms. For example, instant messaging services use centralized servers to authenticate accounts and locate peers, but switch to direct peer-to-peer media streams (WebRTC) for low-latency audio/video calls.


1.5 Protocols and standards, need of standardization

Definition

Network Protocol

A network protocol is a formal set of predefined rules, conventions, and data formats that govern how two or more entities communicate across a network. A protocol specifies what is communicated, how it is communicated, and when it is communicated.

Three Key Elements of a Protocol

Every network protocol is formally defined by three fundamental components:

  1. Syntax: Refers to the structure or format of the transmitted data, including bit fields, header lengths, delineation markers, and field ordering. For example, the first of an IPv4 header denote the IP version number.
  2. Semantics: Refers to the precise meaning interpreted from each section of bits. It dictates how a device must act upon receiving a specific bit pattern or error code (e.g., whether to retransmit, forward, or discard a datagram).
  3. Timing: Encompasses two characteristics: when data should be transmitted and how rapidly it can be sent. It governs synchronization, transmission speed matching (flow control), and retransmission timeouts.

Need for Standardization

In early computer networking, proprietary protocols designed by individual vendors (such as IBM Systems Network Architecture and DECnet) locked customers into closed hardware ecosystems. Equipment from different manufacturers could not interoperate. Standardization ensures:

Major Standards Organizations

Key Standards Organizations in Computer Networking
OrganizationFull NameMajor Networking Contributions
ISOInternational Organization for StandardizationDeveloped the 7-layer OSI Reference Model (ISO 7498), OSI protocol family
IEEEInstitute of Electrical and Electronics EngineersStandardized local network protocols under IEEE 802 (802.3 Ethernet, 802.11 Wi-Fi)
IETFInternet Engineering Task ForceDevelops Internet protocol standards published as RFCs (Request for Comments: TCP, UDP, IP, HTTP)
ITU-TInternational Telecommunication Union - TelecommunicationGlobal telecommunications standards: V-series modems, X.25, ATM, optical transmission (G.652)
ANSIAmerican National Standards InstituteASCII character encoding, FDDI optical token ring standard
W3CWorld Wide Web ConsortiumWeb standards: HTML, XML, CSS, WebSockets

1.6 Layered network architecture, OSI and TCP/IP reference models

To manage the enormous complexity of network communications, computer network functionality is structured hierarchically into layers. Each layer performs a specific, well-defined set of functions and provides an abstract service interface to the layer immediately above it, while relying on the services provided by the layer immediately below it.

The OSI 7-Layer Reference Model

Developed by ISO in 1984, the Open Systems Interconnection (OSI) model divides network communication into seven logical layers:

  1. Layer 7 — Application Layer: Provides network services directly to end-user applications and processes (e.g., HTTP for web browsing, SMTP for email, DNS for name resolution).
  2. Layer 6 — Presentation Layer: Handles data representation, syntax conversion, character code translation (e.g., EBCDIC to ASCII), data compression, and cryptographic encryption/decryption.
  3. Layer 5 — Session Layer: Establishes, manages, synchronizes, and terminates communication sessions (dialogues) between presentation entities. Implements checkpoints for session recovery.
  4. Layer 4 — Transport Layer: Provides end-to-end (process-to-process) reliable or best-effort communication. Responsibilities include segmentation, reassembly, connection management, port multiplexing, flow control, and error recovery.
  5. Layer 3 — Network Layer: Responsible for source-to-destination (host-to-host) packet delivery across multiple interconnected networks. Functions include logical addressing (IPv4/IPv6), routing, and packet forwarding.
  6. Layer 2 — Data Link Layer: Responsible for error-free node-to-node (hop-to-hop) frame transmission across a physical link. Functions include framing, physical MAC addressing, flow control, and error detection (CRC).
  7. Layer 1 — Physical Layer: Transmits raw, unstructured bit streams over physical transmission media. Defines electrical voltages, optical pulses, connector pinouts, cable specifications, and modulation schemes.

Encapsulation, Decapsulation, and Protocol Data Units (PDUs)

As user data travels downward through the protocol stack at the sending node, each successive layer prepends a header (and the data link layer appends a trailer) containing layer-specific control information. This process is called data encapsulation. At the receiving host, the reverse process, decapsulation, strips off the headers layer-by-layer.

Protocol Data Units (PDUs) Across Layers
OSI LayerPDU NameTypical Header / Content Information
Layer 7: ApplicationApplication Data / MessageUser data payload, application-specific request headers
Layer 4: TransportSegment (TCP) / Datagram (UDP)Source Port, Destination Port, Sequence Number, Checksum
Layer 3: NetworkPacket / DatagramSource IP Address, Destination IP Address, TTL, Protocol ID
Layer 2: Data LinkFrameSource MAC, Destination MAC, EtherType, CRC / FCS Trailer
Layer 1: PhysicalBitsRaw digital bitstream encoded into physical electrical/optical signals

The TCP/IP Protocol Suite

The practical architecture of the global Internet is the TCP/IP model (standardized by the IETF). Rather than seven layers, it uses a streamlined four- or five-layer model:

AspectOSI ModelTCP/IP Model
Number of LayersExactly 7 layers4 layers (original RFC 1122) or 5 layers (modern pedagogical model)
Application Layer HandlingStrictly separates Application, Presentation, and Session layersConsolidates Application, Presentation, and Session functions into a single Application layer
Physical / Link LayerStrictly separates Data Link and Physical layersOriginal model merged them into the Network Access (Link) layer
Development ApproachTheoretical model created before protocols were fully written (concept-driven)Protocols were designed first (TCP, IP), model was formalized afterwards (practical)
Network Layer ServiceSupports both connectionless and connection-oriented network servicesSupports only connectionless network service (IP datagram delivery)
Transport Layer ServiceSupports connection-oriented and connectionless transportSupports both (TCP is connection-oriented; UDP is connectionless)

1.7 Addressing at different layers

Communication between processes across interconnected networks requires unique identifiers at each layer of the protocol stack:

  1. Physical (MAC) Address (Data Link Layer - Layer 2):
    • A () flat hardware address burned into the Network Interface Card (NIC).
    • Represented as twelve hexadecimal digits separated by colons or hyphens (e.g., 00:1A:2B:3C:4D:5E).
    • The first form the Organizationally Unique Identifier (OUI) assigned by IEEE to the manufacturer; the remaining are assigned by the vendor.
    • Used exclusively for hop-to-hop frame delivery within the same broadcast domain (local network).
  2. Logical (IP) Address (Network Layer - Layer 3):
    • A globally unique hierarchical address identifying a host or router interface.
    • IPv4: (), written in dotted-decimal format (e.g., 192.168.1.100), partitioned into network ID and host ID portions.
    • IPv6: (), written as eight groups of four hexadecimal digits separated by colons (e.g., 2001:0db8:85a3::8a2e:0370:7334).
    • Used for end-to-end packet routing across multiple heterogeneous networks.
  3. Port Address (Transport Layer - Layer 4):
    • A integer ( to ) identifying a specific executing application process on a given host.
    • Enables transport multiplexing so that multiple applications (e.g., web browser, email client, terminal session) can share a single IP address simultaneously.
    • Well-Known Ports (–): Assigned by IANA for standard services (HTTP: , HTTPS: , SSH: , DNS: , SMTP: ).
    • Registered Ports (–): Vendor-specific application services.
    • Dynamic / Private / Ephemeral Ports (–): Temporarily chosen by client operating systems for outbound connections.
  4. Specific / Application Address (Application Layer - Layer 7):
    • Human-readable identifiers designed for user convenience, such as Uniform Resource Locators (https://www.ioe.edu.np) and email addresses ([email protected]), translated automatically into IP addresses via DNS.
Comprehensive Summary of Network Addressing Across Protocol Layers
LayerAddress TypeAddress LengthExamplePrimary Purpose
Layer 7Application / URLVariablehttps://tu.edu.npHuman-friendly service identification
Layer 4Port Address (), , Distinguishes process/socket on host
Layer 3Logical (IP) Address (v4) / (v6)10.0.4.15Global host routing across networks
Layer 2Physical (MAC) Address ()A4:83:E7:2C:11:9BHop-to-hop frame delivery on local link

1.8 Networking devices: Repeater, hub, bridge, switch, router, gateway

Networking devices operate at specific layers of the protocol hierarchy to connect network segments, manage traffic flow, and isolate collision or broadcast domains:

Definition

Collision Domain and Broadcast Domain

Device Breakdown by Operating Layer

  1. Repeater (Layer 1 — Physical):
    • An active physical-layer device that regenerates and amplifies incoming electrical, optical, or radio signals attenuated by transmission distance.
    • Operates strictly on raw bits; it does not parse frame headers, IP packets, or MAC addresses.
    • Domain Isolation: Extends the collision domain; does not isolate collision domains or broadcast domains.
  2. Hub (Layer 1 — Physical):
    • Effectively a multiport repeater. When a signal arrives on any one port, the hub amplifies and broadcasts (floods) it out to all other ports, regardless of the intended destination.
    • Shared bandwidth among all connected nodes.
    • Domain Isolation: All connected devices reside in a single collision domain and a single broadcast domain.
  3. Bridge (Layer 2 — Data Link):
    • Connects two or more LAN segments using MAC addresses to make forwarding decisions.
    • Maintains an internal MAC address table (forwarding database) built dynamically by reading source MAC addresses in passing frames.
    • Domain Isolation: Isolates collision domains (each bridge port is its own separate collision domain), but all ports remain in the same broadcast domain.
  4. Switch (Layer 2 — Data Link):
    • Essentially a high-speed, multiport hardware bridge. An ASIC (Application-Specific Integrated Circuit) switch cross-connects ports at wire speed.
    • Supports full-duplex operation (simultaneous transmission and reception without collisions).
    • Frames are forwarded selectively only to the specific port connected to the destination MAC address (unicast), unless the address is unknown or broadcast.
    • Domain Isolation: Every single switch port forms an independent collision domain, eliminating collisions entirely in full-duplex mode. All ports share a single broadcast domain (unless partitioned with VLANs).
  5. Router (Layer 3 — Network):
    • An intelligent internetworking device that inspects Layer 3 logical IP addresses and consults dynamic routing tables (OSPF, RIP, BGP) to determine the optimal path for forwarding packets between distinct subnets or autonomous systems.
    • Connects heterogeneous physical media (e.g., Ethernet LAN to optical fiber WAN).
    • Domain Isolation: Breaks both collision domains and broadcast domains. A router does not forward Layer 2 broadcast frames across its interfaces by default.
  6. Gateway (Application / All Layers):
    • A protocol converter that interconnects systems utilizing fundamentally different protocol architectures, data formats, or operating models (e.g., connecting an IPv4 network to an IPv6 network, or translating an enterprise VoIP SIP network into legacy SS7 telecom PSTN).
Comparison of Networking Interconnection Devices
DeviceOSI Operating LayerPrimary Forwarding KeyIsolates Collision Domains?Isolates Broadcast Domains?Typical Media Bandwidth
RepeaterLayer 1 (Physical)None (bit regeneration)NoNoShared across all segments
HubLayer 1 (Physical)None (blind electrical flood)NoNoShared across all ports
BridgeLayer 2 (Data Link)48-bit MAC addressYes (per port)NoDedicated per port segment
SwitchLayer 2 (Data Link)48-bit MAC addressYes (per port)No (single without VLAN)Dedicated full-duplex wire-speed
RouterLayer 3 (Network)32-bit / 128-bit IP addressYes (per interface)Yes (per interface)Independent subnet wire-speed
GatewayLayers 4–7 (Transport–App)Application payload / protocolYesYesConstrained by translation CPU

Worked Out Examples

Example 1.1

1.1

A newly established engineering campus laboratory requires interconnecting computer workstations. Compare the physical hardware requirements for deploying these workstations in:

  1. A fully connected Mesh topology.
  2. A Star topology centered around a modern Layer 2 Ethernet switch.

Specifically calculate:

Part 1 — Fully Connected Mesh Topology Analysis: In a full mesh topology, every node maintains a direct point-to-point physical connection with every other node. For nodes:

  • Each node must connect to peers, requiring network interface ports per workstation.
  • The total number of duplex physical communication links is given by the combination formula:
  • Total workstation network ports required across all machines:
  • Fault Impact: If any single cable link fails, only direct communication between that specific pair of workstations is severed; the two machines can still communicate by routing traffic through intermediate nodes. The remaining workstations experience zero impact.

Part 2 — Star Topology Analysis: In a star topology, each workstation connects via a dedicated point-to-point link directly to the central switch:

  • Each workstation requires exactly network interface card (NIC) port.
  • The number of physical duplex cables required is exactly equal to the number of nodes:
  • The central switch must have at least ports.
  • Total ports across the entire system:
  • Fault Impact: If an individual workstation cable breaks, only that single workstation loses network access; all other stations continue communicating without disruption. However, if the central switch hardware fails, the entire network is disabled.
Answer:
  1. Full Mesh Topology: Requires physical links, ports per workstation, and total ports. Single link failure causes minimal disruption.
  2. Star Topology: Requires physical links, port per workstation, and total ports (12 on workstations + 12 on switch). Highly cost-effective; failure of the central switch is a single point of failure.
Example 1.2

1.2

An application process generates a user data message of and passes it down the protocol stack for transmission over an Ethernet LAN. Assume standard protocol headers with no optional fields:

Calculate:

  1. The total size of the transmitted Layer 2 Ethernet frame in bytes.
  2. The total protocol encapsulation overhead in bytes.
  3. The protocol transmission efficiency (percentage of useful payload to total transmitted frame size).
  4. The percentage of bandwidth consumed by protocol overhead.

Evaluating Total Frame Size and Protocol Encapsulation Overhead: Data travels down the layers, accumulating headers and trailers:

  • Layer 4 (Transport): Prepend TCP header .
  • Layer 3 (Network): Prepend IPv4 header .
  • Layer 2 (Data Link): Prepend Ethernet header () and append FCS trailer ().

Total protocol overhead added across all layers:

Calculating Transmission Efficiency and Overhead Proportion: Protocol payload efficiency is the ratio of useful application payload to the total frame size:

The percentage of bandwidth consumed by protocol headers and trailers:

Notice that .

Answer:
  1. Total Layer 2 frame size: .
  2. Total protocol encapsulation overhead: .
  3. Protocol transmission efficiency: .
  4. Overhead bandwidth percentage: .
Example 1.3

1.3

Consider an enterprise branch office network topology composed of:

Determine:

  1. The total number of distinct Collision Domains in the network.
  2. The total number of distinct Broadcast Domains in the network (assume standard default configuration with no 802.1Q VLANs).

Provide explicit justification based on device operating layers.

Analyzing Collision Domains:

  • Hub : A physical-layer device (Layer 1). A hub cannot isolate collision domains. Therefore, all PCs, the hub internal bus, and the router interface together form collision domain.
  • Switch : A data link-layer device (Layer 2). Every active port on a switch isolates and constitutes its own independent collision domain:
    • link connecting Switch to Router interface : collision domain.
    • links connecting Switch to individual desktop PCs: collision domains.
    • link connecting Switch to the network printer: collision domain.
    • link connecting Switch to the wireless Access Point (AP): collision domain (the shared wireless half-duplex medium among the laptops acts as part of this collision zone).
    • Total switch-side collision domains: collision domains.

Summing both sides:

Analyzing Broadcast Domains:

  • Broadcast frames (such as ARP requests with destination MAC FF:FF:FF:FF:FF:FF) are forwarded across all ports of hubs and switches.
  • Routers (Layer 3) do not forward Layer 2 broadcast frames between their interfaces by default; each router interface terminates the broadcast domain.
  • Subnet on interface (the entire Hub segment with its 5 PCs) forms broadcast domain.
  • Subnet on interface (the entire Switch segment, including all 8 PCs, printer, and all 10 laptops via the AP) forms broadcast domain.
Answer:
  1. Total Collision Domains: ( for the shared hub segment + separate collision domains across the active switch ports).
  2. Total Broadcast Domains: (demarcated by the two distinct interfaces of Router ).

Practice Exercises

Practice Exercises — Introduction to Computer Networks

Question 1

Compare the OSI 7-Layer Reference Model and the TCP/IP Protocol Suite. Explain why the OSI model failed to become the dominant commercial standard despite its theoretical elegance.

Architectural and Layer Mapping Comparison:

  • Layer Granularity: The OSI model features 7 discrete layers (Physical, Data Link, Network, Transport, Session, Presentation, Application). The TCP/IP model condenses Session, Presentation, and Application functionalities into a single consolidated Application Layer, and groups Physical and Data Link functions into a Network Interface / Link Layer (or 5 layers in modern descriptions).
  • Service Models: At the Network Layer, OSI supports both connectionless (CLNS) and connection-oriented (CONS) services; TCP/IP provides strictly connectionless datagram service (IP). At the Transport Layer, both architectures support both connection-oriented (OSI TP4, TCP) and connectionless (OSI TP0, UDP) modes.
  • Philosophy: OSI is a theoretical, formal reference architecture developed before protocol implementations were fully written; TCP/IP was engineered pragmatically to solve real internetworking problems (ARPANET), with the model formalized after the protocols proved successful.

Reasons for Commercial Dominance of TCP/IP over OSI:

  1. Bad Timing: TCP/IP protocols were already thoroughly tested, stable, and freely integrated into Berkeley UNIX (4.2BSD) when the complex OSI standards were finalized.
  2. Bad Technology: The OSI model suffered from unnecessary complexity; the Session and Presentation layers are sparse in function and rarely needed as separate entities, while the Data Link and Network layers are heavily overloaded.
  3. Bad Implementations: Early OSI implementations were notorious for being slow, memory-intensive, and resource-heavy compared to the lightweight, efficient TCP/IP stack.
  4. Bad Politics: TCP/IP was backed by the US Department of Defense and freely disseminated to research universities, creating an enormous installed base before commercial OSI products reached the market.
Answer:

The OSI model defines 7 distinct layers with strict separation of concerns, whereas TCP/IP consolidates the top three layers into an Application layer and uses a connectionless network layer (IP). TCP/IP dominated commercially due to superior timing, zero licensing costs, direct integration into UNIX, practical simplicity, and early widespread adoption on the ARPANET.

Question 2

An enterprise branch is designing a network for critical database servers.

  1. Compute the number of duplex cable links and network ports per host required for a Full Mesh topology.
  2. Compute the number of cable links and host ports required for a Star topology.
  3. Recommend which topology is better suited for a high-availability data center backbone versus an office floor LAN, justifying your choice.

Full Mesh Topology Calculation for Hosts:

  • Number of links:
  • Number of physical I/O ports per server:
  • Total host network ports across the cluster: .

Star Topology Calculation for Hosts:

  • Number of duplex cable links:
  • Number of physical I/O ports per server: exactly port per host.
  • Central switch ports required: ports. Total system ports .

Engineering Recommendation and Justification:

  • High-Availability Data Center Backbone: A partial or full mesh topology is preferred between core routers and switches because zero-downtime and multiple redundant failover paths are mandatory.
  • Office Floor / End-User LAN: A star topology is vastly superior due to low cabling cost, minimal port requirements, easy troubleshooting, and straightforward host moves/adds/changes.
Answer:
  1. Full Mesh: links, ports per host, total ports.
  2. Star Topology: links, port per host, total ports.
  3. Mesh is suited for core data center routing backbones where redundancy is paramount; Star is ideal for end-user LANs due to cost, simplicity, and manageable cabling.
Question 3

Differentiate between a Hub, a Layer 2 Switch, and a Router on the basis of:

  1. Primary OSI operating layer.
  2. Collision domain isolation.
  3. Broadcast domain isolation.
  4. Primary forwarding logic and addressing table.

Comprehensive Device Differentiation:

Comparison of Hub, Switch, and Router
ParameterHubLayer 2 SwitchRouter
OSI LayerLayer 1 (Physical)Layer 2 (Data Link)Layer 3 (Network)
Collision DomainDoes not isolate; all ports share collision domainIsolates collision domains per port (each port is domain)Isolates collision domains on each physical interface
Broadcast DomainDoes not isolate; floods broadcasts to all portsDoes not isolate; all ports share broadcast domain (without VLAN)Isolates broadcast domains; does not forward broadcasts
Forwarding LogicBlind electrical repeating/flooding to all portsInspects destination MAC address; consults MAC address table (CAM)Inspects destination IP address; consults Routing Table
Transmission ModeHalf-duplex onlyFull-duplex supported on every portFull-duplex supported
Answer:

A Hub operates at Layer 1 and creates a single shared collision and broadcast domain with blind electrical flooding. A Switch operates at Layer 2, isolates collision domains on each individual port using a MAC address table, but maintains a single broadcast domain. A Router operates at Layer 3, isolates both collision domains and broadcast domains on each interface, and forwards packets between subnets using an IP routing table.

Question 4

Explain the four levels of network addressing defined in the Internet protocol hierarchy: Physical (MAC) address, Logical (IP) address, Port address, and Specific / Application address. Explain why MAC addressing alone is insufficient for global internetworking.

Four Levels of Network Addressing:

  1. Physical Address (Layer 2 MAC): A flat hardware address assigned by the manufacturer to the NIC. Used strictly for local hop-to-hop frame delivery between devices sharing the same physical or data link broadcast network.
  2. Logical Address (Layer 3 IP): A (IPv4) or (IPv6) hierarchical address partitioned into network ID and host ID portions. Identifies a host interface globally and enables routers to direct packets across heterogeneous networks.
  3. Port Address (Layer 4): A number ( to ) identifying an individual software process or socket within a host. Allows simultaneous multiplexing of multiple network connections over a single IP address.
  4. Application / Specific Address (Layer 7): User-friendly symbolic identifiers such as Uniform Resource Locators (https://example.org) or email addresses ([email protected]), mapped to IP addresses using DNS.

Why MAC Addressing Alone is Insufficient for Global Internetworking:

  • Flat vs. Hierarchical Structure: MAC addresses are flat (assigned arbitrarily based on manufacturer and production batch), possessing no geographical or topological hierarchy. An internet router cannot aggregate routes based on MAC addresses; routing tables would have to store billions of flat MAC entries, causing catastrophic router memory and lookup exhaustion.
  • Media Heterogeneity: Different physical and data link layer technologies use different addressing formats (or no MAC addresses at all, such as point-to-point serial links). The Logical IP address provides a uniform, media-independent abstraction over all underlying link technologies.
Answer:

The four addressing levels are Physical (48-bit MAC for local link delivery), Logical (32/128-bit IP for hierarchical global routing), Port (16-bit for process multiplexing), and Specific (symbolic names like URLs). MAC addressing is flat and media-dependent, making route aggregation impossible; hierarchical IP addressing is required for scalable global routing across diverse networks.

Question 5

A client application sends a file block of (the standard Maximum Segment Size, MSS, for Ethernet) using TCP over IPv4 on an IEEE 802.3 Ethernet LAN. Assume:

  1. Trace the encapsulation process at each layer, stating the PDU name and size.
  2. Compute the total frame length and the protocol payload efficiency.
  3. If an intermediate router fragments this packet into two fragments with payload sizes of and respectively (each requiring its own IP header), determine the total overhead of the transmission.

Encapsulation Process and PDU Sizes:

  • Layer 7 Application Layer: Application payload (Message).
  • Layer 4 Transport Layer: TCP prepends a header:
  • Layer 3 Network Layer: IPv4 prepends a header:

(This exactly equals the standard Ethernet Maximum Transmission Unit, MTU).

  • Layer 2 Data Link Layer: Ethernet prepends a MAC header and appends a FCS trailer:
  • Payload Efficiency:

Overhead Under Fragmentation: If fragmented into two IP fragments:

  • Fragment 1: payload IP header Ethernet L2 overhead .
  • Fragment 2: payload IP header Ethernet L2 overhead .
  • Total transmitted bytes across both fragments: .
  • Total overhead:

(The additional of Ethernet and duplicate of IP header increases total overhead from to ).

Answer:
  1. Encapsulated PDUs: Segment (), Packet (), Frame ().
  2. Total frame length: ; efficiency: .
  3. Under fragmentation into two frames, total bytes transmitted , yielding a total overhead of .
Physical Layer →