Computer NetworksUnit 112 min read
Computer Networks: Definitions, Topologies, Devices & Security
Unit 1 of Computer Networks covers the foundational concepts of computer networks, including definitions, types, topologies, network devices, and security basics. This note explains how networks function, their advantages, disadvantages, and real-world applications, with visual aids for clarity.
TAKEAWAYS:
- Computer networks connect devices to share resources, improve communication, and enable distributed computing.
- Network topologies (star, bus, ring, mesh) determine how devices connect and communicate, each with unique advantages and drawbacks.
- Network devices (hub, switch, bridge, router) operate at different OSI layers to manage data flow and connectivity.
- Security in networks involves encryption (HTTPS, RSA), authentication, and protection against threats like congestion and unauthorized access.
- Real-world examples like eSewa (secure transactions), Pathao (routing algorithms), and Ncell (network infrastructure) demonstrate practical applications.
1. Definition and Types of Computer Networks
A computer network is a collection of interconnected devices (computers, servers, routers, etc.) that communicate and share resources (data, files, internet access) using standardized protocols. Networks can be classified based on their scope, size, and ownership:
Classification by Scope
| Type | Coverage | Example |
|---|---|---|
| PAN | Personal Area Network (1-10m) | Bluetooth headset, USB connection |
| LAN | Local Area Network (1 building) | Office network, home Wi-Fi |
| MAN | Metropolitan Area Network (city) | NTC fiber network in Kathmandu |
| WAN | Wide Area Network (country/globe) | Internet, Ncell mobile network |
Classification by Ownership
- Public Network: Open to all (e.g., Internet, Wi-Fi hotspots).
- Private Network: Restricted access (e.g., bank internal networks, corporate LANs).
- Hybrid Network: Combines public and private (e.g., VPNs for remote access).
Why Use Networks?
Advantages:
- Resource sharing (printers, files, internet).
- Cost-effective communication (email, video calls).
- Centralized data management (databases, backups).
- Scalability (easy to add more devices).
Disadvantages:
- Security risks (hacking, viruses).
- Complexity in management.
- Dependency on infrastructure (power, cables, ISPs).
2. Network Topologies
Topology refers to the physical or logical layout of devices in a network. The choice affects performance, cost, and scalability.
Common Topologies
| Topology | Description | Advantages | Disadvantages | Example |
|---|---|---|---|---|
| Star | Central device (hub/switch) connects all nodes. | Easy to manage, fault isolation. | Single point of failure (central device). | Home Wi-Fi router. |
| Bus | All devices share a single cable. | Low cost, easy to install. | Cable failure disrupts entire network. | Old Ethernet networks (10BASE2). |
| Ring | Devices connected in a closed loop. | Equal access, no collisions. | Failure in one node affects all. | Token Ring networks (rare today). |
| Mesh | Every device connected to every other. | High redundancy, robust. | Expensive, complex setup. | Military networks, Ncell backbone. |
Worked Example: Traffic in Kathmandu (Bus vs. Star)
Bus Topology (Like Old Roads): If one major road (cable) is blocked, traffic (data) stops for all. Analogy: A single busy street (e.g., Thapathali) where all vehicles (devices) depend on it.
Star Topology (Like Modern Roundabouts): If one roundabout (central switch) fails, traffic reroutes via alternative paths. Analogy: Kathmandu’s ring road system where traffic can bypass a jammed area.
3. Network Devices
Devices enable communication between networks or within a network. They operate at different OSI layers (we’ll cover layers in Unit 2).
Key Devices and Their Functions
| Device | OSI Layer | Function | Example |
|---|---|---|---|
| Hub | Physical | Broadcasts data to all connected devices (no intelligence). | Old Ethernet hubs. |
| Switch | Data Link | Intelligently forwards data to specific devices using MAC addresses. | Modern home/office switches. |
| Bridge | Data Link | Connects two LANs, filters traffic between them. | Used in corporate networks. |
| Router | Network | Connects different networks (LAN to WAN), uses IP addresses to route data. | NTC routers, home Wi-Fi modems. |
| Gateway | Application | Translates between different protocols (e.g., LAN to Internet). | Firewall, VPN gateways. |
How a Router Works (Worked Example)
Scenario: You send a request to access www.esewa.com from your home network.
- Your device sends a packet to the default gateway (router).
- The router checks its routing table to find the best path to eSewa’s server.
- It forwards the packet to the ISP (e.g., NTC or Worldlink).
- The ISP routes it globally via the Internet backbone.
- eSewa’s server responds, and the packet retraces the path back to you.
sequenceDiagram
participant User
participant HomeRouter
participant ISP
participant eSewaServer
User->>HomeRouter: HTTP Request (www.esewa.com)
HomeRouter->>ISP: Forward packet (via routing table)
ISP->>eSewaServer: Route globally
eSewaServer-->>ISP: HTTP Response
ISP-->>HomeRouter: Return packet
HomeRouter-->>User: Display webpage4. Network Security Basics
Security ensures confidentiality, integrity, and availability of data. Threats include:
- Unauthorized access (hacking, brute-force attacks).
- Data breaches (e.g., credit card theft).
- Denial of Service (DoS) (overloading a server).
- Malware (viruses, ransomware).
Security Mechanisms
Encryption:
- HTTPS: Secure version of HTTP (uses SSL/TLS to encrypt data). Example: When you log in to eSewa, your password is encrypted before transmission.
- RSA Algorithm: Asymmetric encryption (public/private key pairs). Example: Used in Khalti for secure transactions between buyer and seller.
Firewalls:
- Filters traffic between trusted and untrusted networks. Example: A bank’s firewall blocks unauthorized access to customer databases.
Proxy Servers:
- Acts as an intermediary between users and the Internet.
- Roles:
- Caching (storing frequently accessed data).
- Content filtering (blocking malicious sites).
- Anonymity (hiding user IP addresses). Example: Schools use proxy servers to block social media during exams.
Comparison: HTTP vs. HTTPS
| Feature | HTTP | HTTPS |
|---|---|---|
| Security | No encryption (plaintext). | Encrypted (SSL/TLS). |
| Port | 80 | 443 |
| Use Case | Internal networks, testing. | E-commerce, banking, logins. |
| Example | http://example.com |
https://esewa.com |
5. Congestion and Control Mechanisms
Congestion occurs when too much data floods a network, causing delays or packet loss. Example: During Daraz’s Big Shopping Days, too many users accessing the site simultaneously may slow it down.
Congestion Control Techniques
Preventive Measures:
- Traffic Shaping: Limits data flow to avoid overload.
- Load Balancing: Distributes traffic across multiple servers. Example: NEPSE’s website uses load balancers to handle high traffic during trading hours.
Detective Measures:
- Monitoring Tools: Track network performance (e.g., bandwidth usage).
- Thresholds: Set limits for acceptable delay/packet loss.
Recovery Measures:
- Dynamic Routing: Redirects traffic if a path is congested.
- Packet Dropping: Discards excess packets to reduce load.
TCP Congestion Control (Worked Example)
TCP uses slow start, congestion avoidance, and fast retransmit to manage congestion. Scenario: You’re downloading a large file from Google Drive on a slow network.
- TCP starts with a small window size (slow start).
- If packets arrive without loss, the window increases (congestion avoidance).
- If packets are lost, TCP reduces the window size and retransmits.
In the Real World
eSewa and Khalti (Security & Encryption):
- These apps use HTTPS and RSA encryption to secure transactions between users and banks. When you pay a bill, your card details are encrypted end-to-end, preventing interception by hackers.
Pathao (Routing Algorithms):
- Pathao’s app uses network layer routing to match drivers and riders efficiently. The backend servers (like a router) dynamically assign the nearest available driver to minimize wait time, similar to how a router finds the shortest path to a destination.
NTC and Ncell (Network Topologies & Devices):
- NTC’s fiber-optic network in Kathmandu uses a mesh topology for redundancy. If one fiber cable is cut, data reroutes automatically via alternative paths, ensuring uninterrupted service.
- Ncell’s mobile towers act as access points (like switches) connecting users to the core network, which then routes data globally via WAN links.
Bank Loans (Congestion Control Analogy):
- Imagine a bank’s loan approval system as a network. If too many loan requests arrive at once (congestion), the system may slow down or reject some requests temporarily. Banks use load balancing (distributing requests across multiple servers) to handle peak times, similar to how TCP manages data flow.
Exam Tip
- Definitions Matter: Always define terms precisely (e.g., "A network is a collection of autonomous computers interconnected by a single technology...").
- Compare Topologies: Exams often ask to compare star vs. bus vs. ring vs. mesh. Use a table with advantages/disadvantages/examples.
- OSI Layers for Devices: Remember which device operates at which layer:
- Hub: Physical layer.
- Switch: Data Link layer.
- Router: Network layer.
- Real-World Examples: Link concepts to Nepali apps/companies (e.g., eSewa for security, Pathao for routing, NTC for topologies).
- Diagrams are Key: Draw topology diagrams, sequence diagrams for protocols, and state diagrams for congestion control. Label every component!
- Security Focus: For HTTPS/HTTPS or RSA, explain:
- What problem it solves (e.g., "HTTPS prevents eavesdropping on data").
- How it works (e.g., "RSA uses public/private keys for encryption").
- Congestion Control: Explain TCP’s mechanisms (slow start, congestion avoidance) with a state diagram or trace.
Based on the PU BE Computer (PU) syllabus for Computer Networks, unit 1.
Discussion
Loading…