Computer Networking Fundamentals: Protocols, Topologies, and Media

Computer Networks: Definition and OSI Model’s Open Nature

A computer network is a collection of interconnected computers and other hardware devices that are linked together to share resources, exchange data, and communicate. These networks can be connected via wired (e.g., Ethernet) or wireless (e.g., Wi-Fi) means. The main purpose of a computer network is to enable devices to work together, share files, access the internet, and use shared applications or hardware like printers.

Why the OSI Model is Called “Open”

The OSI (Open Systems Interconnection) model is called “open” because:

  • Vendor-Neutral Standard: It was developed by the International Organization for Standardization (ISO) as a universal framework that can be used by any manufacturer or developer, regardless of the brand or technology platform.
  • Interoperability: The model promotes interoperability between different systems and devices by providing a standard structure for communication protocols.
  • Publicly Available: The OSI model is publicly documented, meaning anyone can access and implement it. This openness helps in the development of networking protocols that are compatible and standardized.
  • Guiding Framework: It serves as an open guide for designing and understanding network protocols, even if not all real-world networks implement the model exactly as it is.

Types of Computer Networks

TypeFull FormCoverage AreaDescriptionExamples
PANPersonal Area NetworkVery small (within a few meters)A network for interconnecting personal devices, typically around one person.Bluetooth between phone and headset, USB connections
LANLocal Area NetworkSmall (up to a few kilometers)A network that connects computers within a limited area like a home, office, or school.Office network, school computer lab, home Wi-Fi
MANMetropolitan Area NetworkMedium (covers a city or town)A network that spans a city or a large campus. Larger than LAN but smaller than WAN.Cable TV network, city-wide Wi-Fi, university campus network
WANWide Area NetworkVery large (country or worldwide)A network that covers a broad area, often connecting multiple LANs and MANs across regions.The Internet, corporate networks with global offices

Network Topology: Layouts and Structures

Network topology refers to the arrangement or layout of different network devices (like computers, routers, switches, etc.) and how they are physically or logically connected to each other in a computer network.

Types of Network Topology

  • Physical Topology: The actual layout of cables and devices.
  • Logical Topology: The way data flows through the network regardless of physical design.

Common Network Topologies

TopologyDescriptionAdvantagesDisadvantages
BusAll devices share a single cable.Easy to install, low cost.One cable failure affects the whole network.
StarDevices connect to a central hub.Easy to manage, failure of one device doesn’t affect others.Hub failure brings down the network.
RingDevices form a closed loop.Predictable performance.Failure in one device affects all.
MeshEvery device connects to every other.High reliability and redundancy.Expensive and complex.
TreeHierarchical, combines star + bus.Scalable and easy to manage.If the main cable fails, the network fails.
HybridMix of two or more topologies.Flexible and scalable.Complex and costly.

The OSI Reference Model Explained

The OSI Model is a conceptual framework developed by the ISO (International Organization for Standardization) that standardizes the functions of a communication system into seven distinct layers. It helps different systems communicate over a network.

7 Layers of the OSI Model

LayerNameFunctionExamples
7ApplicationInterfaces with user applicationsWeb browsers, Email (HTTP, FTP)
6PresentationTranslates, encrypts, compresses dataData encryption (SSL), character encoding
5SessionManages sessions and controls dialogsLogin sessions, APIs, NetBIOS
4TransportEnsures reliable data transferTCP, UDP
3NetworkHandles routing and addressingIP, routers
2Data LinkTransfers data between two directly connected nodesMAC address, switches, Ethernet
1PhysicalTransmits raw bit stream over physical mediumCables, hubs, NICs, signals

The TCP/IP Reference Model

The TCP/IP Model (Transmission Control Protocol/Internet Protocol) is the foundation of the internet and real-world networking. It is a simplified, practical model that defines how data should be transmitted over networks.

4 Layers of the TCP/IP Model

LayerCorresponds to OSI Layer(s)FunctionExamples
4. Application LayerOSI Layers 7, 6, 5Provides services to user applicationsHTTP, FTP, SMTP, DNS
3. Transport LayerOSI Layer 4Ensures reliable or fast data deliveryTCP, UDP
2. Internet LayerOSI Layer 3Handles addressing and routing of packetsIP, ICMP, ARP
1. Network Access (Link) LayerOSI Layers 2 & 1Manages physical transmission and MAC addressingEthernet, Wi-Fi, MAC, DSL

OSI Model vs. TCP/IP Model Comparison

AspectOSI ModelTCP/IP Model
Full FormOpen Systems InterconnectionTransmission Control Protocol / Internet Protocol
Developed ByISO (International Organization for Standardization)U.S. Department of Defense
Number of Layers7 layers4 layers
LayersApplication, Presentation, Session, Transport, Network, Data Link, PhysicalApplication, Transport, Internet, Network Access (Link)
ApproachTheoretical model (conceptual framework)Practical model (real-world protocol suite)
Protocol DependencyProtocol-independentBased on standard protocols (TCP, IP)
UsageMainly used for teaching and referenceUsed in real-world networking and the internet
Layer SeparationPresentation and Session layers are separateThese are part of the Application layer
ReliabilityEmphasizes service, interfaces, and layersFocuses on standard protocol communication

TCP vs. UDP: A Comparison

AspectTCP (Transmission Control Protocol)UDP (User Datagram Protocol)
Connection TypeConnection-oriented (establishes a connection before data transfer)Connectionless (no setup before sending data)
ReliabilityReliable – ensures data is delivered correctly and in orderUnreliable – no guarantee of delivery or order
Error CheckingYes, with acknowledgment and retransmissionYes, but no retransmission or acknowledgment
SpeedSlower due to overhead from reliability featuresFaster, with minimal overhead
Data TransferStream-based (continuous flow)Message-based (sends discrete packets)
Use CasesWeb browsing (HTTP/HTTPS), Email (SMTP), File transfer (FTP)Streaming (video/audio), Online games, VoIP, DNS
Header SizeLarger (20 bytes or more)Smaller (8 bytes)
Flow Control & Congestion ControlYesNo

Transmission Media: Wired and Wireless

Transmission media are the physical paths or channels used to transmit data from one device to another in a computer network. They are broadly categorized into guided (wired) and unguided (wireless) media.

1. Guided (Wired) Media

Data travels through a physical medium like cables.

TypeDescriptionExamples / Features
Twisted Pair CablePairs of insulated wires twisted together.
  • Used in LANs, telephones
  • Types: UTP (Unshielded), STP (Shielded)
  • Low cost, easy to install
Coaxial CableCentral copper conductor with shielding.
  • Used in cable TV and early networks
  • Better shielding than twisted pair
Fiber Optic CableUses light signals through glass fibers.
  • Very high speed and bandwidth
  • Immune to electromagnetic interference
  • Used for long-distance and high-speed data transmission

2. Unguided (Wireless) Media

Data is transmitted through the air or vacuum without cables.

TypeDescriptionExamples / Features
Radio WavesOmnidirectional; used for wireless communication.
  • Wi-Fi, AM/FM radio, Bluetooth
  • Long range, penetrates walls
MicrowavesLine-of-sight communication.
  • Used in satellite and mobile networks
  • High frequency and speed
InfraredShort-range, line-of-sight.
  • TV remotes, short-range devices
  • Cannot pass through walls
Satellite CommunicationSignals sent to a satellite and then relayed.
  • Global coverage
  • Used in GPS, TV, and remote internet access

Network Switching: Methods of Data Forwarding

Switching is the process of forwarding data packets between devices in a network. It determines how data travels from the source to the destination.

Types of Switching

  • Circuit Switching: Establishes a dedicated path for the entire communication. Reliable but wastes bandwidth. Example: Traditional telephone calls.
  • Packet Switching: Data is broken into packets that travel independently. Efficient and flexible but can have delays. Example: The Internet.
  • Message Switching: The entire message is sent to each node, stored, then forwarded. No dedicated path, but slower due to storage delays. Example: Email systems (older method).

Circuit Switching vs. Packet Switching

AspectCircuit SwitchingPacket Switching
ConnectionDedicated path established for entire sessionNo dedicated path; data sent in packets independently
Data TransferContinuous, real-time communicationData broken into packets, sent separately
EfficiencyInefficient; bandwidth reserved even if idleEfficient; bandwidth shared among users
DelayLow delay once circuit is set upVariable delay due to routing and congestion
ExampleTraditional telephone networksInternet, LANs
ReliabilityHigh reliability during connectionPossible packet loss or delay

Datagram Switching vs. Virtual Circuit Switching

AspectDatagram SwitchingVirtual Circuit Switching
Path SetupNo prior path setup; each packet routed independentlyPath is established before data transfer begins
Packet RoutingEach packet may take a different routeAll packets follow the same pre-established path
Packet NumberingPackets may arrive out of orderPackets arrive in order
Connection TypeConnectionlessConnection-oriented
ReliabilityLess reliable; possible out-of-order or lost packetsMore reliable due to fixed path and order
ExampleInternet Protocol (IP)Frame Relay, ATM networks

Data Link Layer: Functions and Protocols

The Data Link Layer is the 2nd layer of the OSI model. Its main job is to provide reliable and error-free data transfer between two directly connected nodes in a network.

Key Functions of the Data Link Layer

  1. Framing: Divides the bit stream from the Physical Layer into manageable frames.
  2. Physical Addressing: Adds MAC (Media Access Control) addresses to frames to identify source and destination devices on the same network.
  3. Error Detection and Correction: Detects errors in transmitted frames using techniques like CRC and may request retransmission.
  4. Flow Control: Manages the pace of data transmission to prevent a fast sender from overwhelming a slow receiver.
  5. Access Control: Determines which device has the right to use the transmission medium, especially in shared networks (e.g., Ethernet).
  6. Reliable Delivery: Ensures frames are delivered to the next node correctly and in order.

Pure ALOHA vs. Slotted ALOHA

AspectPure ALOHASlotted ALOHA
Time DivisionNo time slots; users transmit anytimeTime divided into slots; users transmit only at slot start
Collision ChanceHigher, collisions can occur anytimeLower, collisions occur only if packets overlap in the same slot
EfficiencyAbout 18.4% (maximum throughput)About 36.8% (maximum throughput)
SynchronizationNot requiredRequired to synchronize users to time slots
UsageSimpler but less efficientMore complex but more efficient

Routing Protocols: RIP and OSPF

  • RIP (Routing Information Protocol):
    • Distance Vector protocol using hop count as a metric.
    • Sends full routing table every 30 seconds to neighbors.
    • Maximum hop count = 15 (beyond that is unreachable).
    • Simple but slow and not suitable for large networks.
  • OSPF (Open Shortest Path First):
    • Link State protocol using cost based on bandwidth.
    • Shares link information with all routers, builds a network map.
    • Uses Dijkstra’s algorithm for the shortest path.
    • Faster, scalable, and better for large/complex networks.