Comp Computer Science

Computer ScienceUnit 218 min read

Data Communication & Networking: Models, Protocols & Devices

Unit 2 of Computer Science explains how data travels between computers—covering OSI/TCP models, transmission media, networking devices, and real-world applications like the internet. Learn with diagrams, examples, and NEB-style questions.

TAKEAWAYS:

  • Data communication requires sender → medium → receiver with protocols like OSI’s 7 layers or TCP/IP’s 4 layers.
  • Transmission media (wired/cable vs. wireless) affect speed, cost, and distance—copper cables are cheap but slow; fiber is fast but expensive.
  • Networking devices (routers, switches, hubs) route data differently: switches use MAC addresses; routers use IP addresses.
  • Topologies (star, bus, mesh) determine how devices connect—star is reliable but needs a central hub.
  • Protocols (HTTP, FTP, SMTP) define rules for data exchange—HTTP for web pages, FTP for file transfers.
  • NEB exams test definitions, comparisons (e.g., OSI vs. TCP), and real-world scenarios (e.g., "Why use fiber optics?").

What Is Data Communication?

Data communication is the exchange of data between two devices (e.g., computer to printer, phone to server). It requires:

  1. A sender (e.g., your laptop).
  2. A medium (wired cable, wireless signal).
  3. A receiver (e.g., a server).
  4. Rules/protocols to ensure data arrives correctly.

Why is it important? Without data communication, the internet, emails, and online banking wouldn’t exist! It’s the backbone of modern technology.


The OSI Model: 7 Layers of Communication

The Open Systems Interconnection (OSI) model is a 7-layer framework that standardizes how data travels. Each layer has a specific job:

Application (Layer 7)DataPresentation (Layer 6)DataSession (Layer 5)DataTransport (Layer 4)SegmentNetwork (Layer 3)PacketData Link (Layer 2)FramePhysical (Layer 1)BitsData encapsulation (down) / De-encapsulation (up)
OSI Model: Data encapsulation at sender (down) and reassembly at receiver (up)

Layers Explained:

Layer Name Function Example Protocols
7 Application Interacts with software (e.g., web browsers, email clients). HTTP, FTP, SMTP
6 Presentation Translates data (e.g., encrypts/decrypts, compresses). SSL, JPEG, MPEG
5 Session Manages connections (e.g., starts/ends communication). NetBIOS, RPC
4 Transport Ensures data arrives complete and in order (like a delivery service). TCP, UDP
3 Network Routes data across networks (like a GPS for packets). IP, ICMP
2 Data Link Handles framing (packets) and MAC addresses (like a local post office). Ethernet, PPP, Wi-Fi
1 Physical Sends raw bits (0s and 1s) via cables/waves. USB, Wi-Fi signals, Fiber

Key Idea:

  • Data moves down the layers at the sender (e.g., your email → encapsulated → sent as bits).
  • At the receiver, it moves up the layers (bits → reassembled → displayed as an email).

TCP/IP Model: The Internet’s Simplified Version

The TCP/IP model is used by the internet and has 4 layers (simpler than OSI):

ApplicationDataTransportSegmentInternetPacketNetwork AccessFrame/BitsTCP/IP encapsulation (down) / De-encapsulation (up)
TCP/IP Model: 4-layer structure (simplified from OSI)
TCP/IP Layer OSI Equivalent Function
Application Layers 5–7 Handles user interactions (e.g., web browsing, emails).
Transport Layer 4 Ensures data delivery (TCP = reliable; UDP = fast but unreliable).
Internet Layer 3 Routes packets using IP addresses (like a global postal service).
Network Access Layers 1–2 Physical transmission (cables, Wi-Fi, MAC addresses).

Why TCP/IP?

  • Simpler than OSI.
  • Used by the internet (e.g., when you load a webpage, TCP/IP handles the data).

Transmission Media: How Data Travels

Data moves via two main types of media:

  1. Guided (Wired) Media: Uses physical cables.
  2. Unguided (Wireless) Media: Uses radio waves, microwaves, or infrared.

1. Guided Media (Wired)

Type Description Advantages Disadvantages Example Uses
Twisted Pair Copper wires twisted to reduce interference. Cheap, easy to install. Slow, susceptible to noise. Telephone lines, Ethernet.
Coaxial Cable Copper core + insulating layers + metal shield. Faster than twisted pair, less noise. Expensive, harder to install. Cable TV, old Ethernet.
Fiber Optic Thin glass/plastic strands transmitting light pulses. Fastest, immune to interference. Very expensive, fragile. Internet backbone, long-distance.

2. Unguided Media (Wireless)

Type Description Advantages Disadvantages Example Uses
Radio Waves Low-frequency waves (e.g., FM radio). Long range, penetrates walls. Slow, prone to interference. Wi-Fi, Bluetooth, TV signals.
Microwaves High-frequency waves (like satellite signals). Fast, used for long distances. Requires line-of-sight (no obstacles). Satellite internet, cell phones.
Infrared Light waves (like TV remotes). Secure, no interference. Short range, blocked by walls. TV remotes, some wireless mice.

Why Choose Wireless?

  • Mobility (e.g., laptops, phones).
  • No cables needed (e.g., Wi-Fi in cafes).

Why Choose Wired?

  • Faster and more secure (e.g., fiber optic for banks).
  • Less interference (e.g., coaxial for cable TV).

Networking Devices: The Traffic Controllers

These devices route, switch, or amplify data in a network.

RepeaterHubLayer 1 (Physical)BridgeSwitchLayer 2 (Data Link)RouterLayer 3 (Network)Network Devices
Network devices categorized by OSI layer

1. Hub

  • Function: Connects multiple devices in a single collision domain (like a party where everyone hears everything).
  • How it works: Broadcasts data to all connected devices (inefficient).
  • Disadvantage: Causes network congestion (like a crowded room).
  • Example: Old Ethernet networks.

2. Switch

  • Function: Connects devices in a separate collision domain (like a smart traffic cop).
  • How it works: Uses MAC addresses to send data only to the intended device.
  • Advantage: Faster and more efficient than a hub.
  • Example: Modern home/office networks.

3. Router

  • Function: Connects different networks (e.g., your home to the internet).
  • How it works: Uses IP addresses to route data between networks (like a post office sorting mail).
  • Key Feature: NAT (Network Address Translation) hides your local IP.
  • Example: Your home Wi-Fi router.

4. Bridge

  • Function: Connects two similar networks (e.g., two Ethernet segments).
  • How it works: Filters data based on MAC addresses (like a one-way door).
  • Use Case: Reducing network traffic in large offices.

5. Repeater

  • Function: Boosts weak signals (like a signal amplifier).
  • Example: Extending Wi-Fi range with a repeater.

Comparison Table:

Device Layer (OSI) Function Example Use Case
Hub Physical Broadcasts to all devices. Old networks (rare now).
Switch Data Link Sends data only to the destination. Home/office networks.
Router Network Connects different networks. Home internet, ISP networks.
Bridge Data Link Connects two similar networks. Office LAN segmentation.
Repeater Physical Amplifies weak signals. Extending Wi-Fi range.

Network Topologies: How Devices Are Connected

The layout of a network affects performance and cost.

1. Bus Topology

  • Structure: All devices connected to a single cable (like a subway line).
  • Advantages:
    • Easy to install.
    • Cheap (uses less cable).
  • Disadvantages:
    • If the main cable fails, the whole network crashes.
    • Slow (collisions occur often).
  • Example: Old Ethernet networks.
graph LR
    A["Device 1"] --|"Shared Cable"| B["Device 2"]
    B --|"Shared Cable"| C["Device 3"]
    C --|"Shared Cable"| D["Device 4"]

2. Star Topology

  • Structure: All devices connected to a central device (like spokes on a wheel).
  • Advantages:
    • Easy to manage (add/remove devices without disrupting others).
    • Faster (less collisions).
    • If one cable fails, others work.
  • Disadvantages:
    • Central device failure = whole network down.
    • More expensive (needs more cables).
  • Example: Home Wi-Fi, office LANs.
graph TD
    A["Central Hub/Switch"] --> B["Device 1"]
    A --> C["Device 2"]
    A --> D["Device 3"]
    A --> E["Device 4"]

3. Ring Topology

  • Structure: Devices connected in a closed loop (like a circular train track).
  • Advantages:
    • Predictable data flow (no collisions).
    • Easy to troubleshoot.
  • Disadvantages:
    • If one device fails, the whole network crashes.
    • Slow for large networks.
  • Example: Token Ring networks (old tech).
Device 1Device 2Device 3Device 4
Ring Topology: Data flows in one direction (token passing)

4. Mesh Topology

  • Structure: Every device connected to every other device (like a spiderweb).
  • Advantages:
    • Very reliable (if one path fails, others take over).
    • Fast (multiple paths for data).
  • Disadvantages:
    • Expensive (needs many cables).
    • Complex to manage.
  • Example: Military networks, underwater cables.
Device 1Device 2Device 3Device 4
Mesh Topology: Every device connected to every other (redundant paths)

Which One to Choose?

Topology Best For Avoid If
Bus Small, temporary networks. Need reliability.
Star Homes, offices (most common). Budget is very tight.
Ring Predictable environments (rare now). Need scalability.
Mesh High-reliability needs (e.g., military). Budget is limited.

Protocols: Rules for Data Exchange

A protocol is a set of rules for communication (like a handshake before talking).

08162431Source Port (16 bits)16 bitsDestination Port (16 bits)16 bitsSequence Number (32 bits)32 bitsAcknowledgment Number (32 bits)32 bitsData Offset (4 bit4 bitsReserved (6bits)6 bitsFlags (9 bits)9 bitsWindow Size (16 bits)16 bits
TCP Segment Header (simplified) – Key fields for reliable data transfer

Common Protocols:

Protocol Layer (OSI) Purpose Example Use
HTTP/HTTPS Application Transfers web pages. Loading websites.
FTP Application Transfers files. Downloading software.
SMTP Application Sends emails. Gmail, Outlook.
TCP Transport Reliable data delivery (like a courier). Web browsing, emails.
UDP Transport Fast but unreliable (like a runner). Video streaming, online games.
IP Network Routes packets using IP addresses. Internet communication.
Ethernet Data Link Defines how data is framed on LANs. Local networks.

Example: How You Load a Webpage

  1. You type google.com → DNS converts it to an IP address (e.g., 142.250.190.46).
  2. Your browser uses HTTP to request the webpage.
  3. TCP ensures the data arrives complete.
  4. IP routes the packet to Google’s server.
  5. The server sends back the webpage via Ethernet/Wi-Fi.

NEB-Style Solved Examples

Example 1: OSI vs. TCP/IP

Question: Compare the OSI and TCP/IP models with respect to layers and functions. Answer:

Feature OSI Model TCP/IP Model
Number of Layers 7 layers. 4 layers.
Layer 1 Physical (bits, cables). Network Access (Physical + Data Link).
Layer 2 Data Link (MAC addresses, framing). Network Access (shared).
Layer 3 Network (IP, routing). Internet (IP, routing).
Layer 4 Transport (TCP/UDP). Transport (TCP/UDP).
Layer 5–7 Session, Presentation, Application. Application (combined).
Used By Theoretical reference. Real-world internet.

Key Difference:

  • OSI is theoretical (used for teaching).
  • TCP/IP is practical (used by the internet).

Example 2: Transmission Media

Question: Why is fiber optic cable preferred for long-distance communication? Answer: Fiber optic cables use light pulses instead of electricity, so they:

  1. Transmit data faster (up to terabits per second).
  2. Avoid interference (immune to electromagnetic noise).
  3. Carry signals farther (up to 100+ km without repeaters).
  4. More secure (harder to tap than copper cables).

Disadvantage: Expensive to install.


Example 3: Network Topologies

Question: Which topology would you choose for a school with 50 computers? Why? Answer: Star topology is best because:

  • Easy to manage: Add/remove computers without disrupting others.
  • Reliable: If one computer fails, others work.
  • Scalable: Can add more computers later.
  • Uses a switch/router: Modern networks support this easily.

Avoid Bus Topology: If the main cable fails, the whole network crashes.


NEB Board-Style Questions (Practice!)

  1. Short Answer:

    • Define data communication.
    • What is the role of the Transport Layer in the OSI model?
    • Differentiate between TCP and UDP.
  2. Long Answer:

    • Explain the OSI model with a diagram. How does data travel from the Application Layer to the Physical Layer?
    • Compare wired and wireless transmission media with examples.
    • Describe star and mesh topologies. Which one is used in modern homes? Why?
  3. Application-Based:

    • Why does your internet slow down when multiple devices are connected to the same router?
    • If a company wants to connect 3 branches with high security, which topology and media would you recommend? Justify.

Exam Tips for NEB

  1. Memorize the OSI Layers:

    • Learn the 7 layers in order (use a mnemonic like "All People Seem To Need Data Processing").
    • Know the function and protocol of each layer.
  2. Compare Tables:

    • NEB loves comparison questions (e.g., OSI vs. TCP/IP, wired vs. wireless).
    • Make tables like the ones above.
  3. Diagrams Are Key:

    • Draw OSI model, topologies, and network devices in exams.
    • Label all parts clearly.
  4. Real-World Applications:

    • Relate concepts to everyday tech (e.g., "Why does Wi-Fi use radio waves?").
    • Explain why a device/topology is used (e.g., "Star topology is used in homes because...").
  5. Common Mistakes to Avoid:

    • Confusing hub vs. switch (hub broadcasts; switch filters).
    • Mixing MAC (Data Link) and IP (Network) addresses.
    • Forgetting that fiber optic is the fastest but most expensive.
  6. Practice Questions:

    • Solve past NEB papers (focus on 2076–2079).
    • Time yourself: 10 minutes per long answer.

Summary Checklist

Before the exam, ensure you can: ✅ Draw and explain the OSI and TCP/IP models. ✅ Compare wired vs. wireless media with examples. ✅ Differentiate between hub, switch, router, and bridge. ✅ Describe 4 network topologies with pros/cons. ✅ Explain TCP vs. UDP and HTTP vs. FTP. ✅ Solve comparison-based questions (e.g., OSI vs. TCP/IP).


Final Thought: Data communication is like sending a letter:

  • You write it (Application Layer).
  • Seal it in an envelope (Presentation).
  • Address it (Network Layer).
  • Hand it to a courier (Physical Layer).
  • The courier ensures it reaches the right person (Transport Layer).

Now you’re ready to ace the NEB exam! 🚀

Based on the NEB +2 Management syllabus for Computer Science (Comp), unit 2.

Discussion

Loading…