Unit 1 - Notes

CSE306 7 min read

Unit 1: INTRODUCTION

1. Introduction to Computer Networks

A Computer Network is a set of interconnected autonomous computing devices designed to exchange information and share resources. These devices (nodes) are linked through communication channels using physical media (like fiber-optic cables or copper wires) or wireless methods (like Wi-Fi or satellite).

Primary Goals of a Computer Network:

  • Resource Sharing: Sharing printers, scanners, storage devices, and software applications among multiple users.
  • High Reliability: Replicating files on multiple machines so that if one goes down, the data is still accessible.
  • Cost Reduction: Centralizing resources and using client-server models to reduce hardware and software costs.
  • Communication Medium: Enabling fast and efficient communication via email, video conferencing, and instant messaging.

2. Networks and Types

Networks are generally classified based on their geographical span.

  • PAN (Personal Area Network): Covers a very small area (typically within 10 meters). Used for connecting personal devices like smartphones, laptops, and wireless headphones. Example: Bluetooth, ZigBee.
  • LAN (Local Area Network): Connects computers within a limited area such as a residence, school, laboratory, or office building. High speed, low error rate, and privately owned. Example: Ethernet, Wi-Fi.
  • MAN (Metropolitan Area Network): Covers a larger geographic area, such as a city or a large campus. It interconnects multiple LANs. Example: Cable television networks, city-wide Wi-Fi.
  • WAN (Wide Area Network): Spans a large geographical area, such as a country, continent, or the entire globe. Uses public, leased, or private communication links. Example: The Internet.

3. Network Software Architecture

Network software is highly structured and organized as a series of layers or levels, each built upon the one below it.

Layers and Protocols

  • Layers: To reduce design complexity, networks are organized as a stack of layers. Each layer offers specific services to the higher layers, shielding them from the details of how the offered services are actually implemented.
  • Protocols: A protocol is a set of rules and conventions that govern the format and meaning of the packets, or messages, exchanged by peer entities within a layer.
  • Interfaces: The interface defines the primitive operations and services the lower layer makes available to the upper one.

Design Issues for the Layers:

  • Error Control: Making communication reliable by detecting and correcting errors (e.g., using checksums).
  • Flow Control: Preventing a fast sender from swamping a slow receiver with data.
  • Multiplexing/Demultiplexing: Combining multiple data streams into a single channel and separating them at the destination.
  • Routing: Determining the best path for data to travel from source to destination.

4. Network Hardware Architecture

Hardware architecture encompasses the physical layout of the network (topology) and the physical devices used to connect nodes.

Network Topologies

Topology refers to the physical or logical arrangement of a network.

  • Bus Topology: All devices share a single communication cable (the backbone). Easy to install but vulnerable to cable failures.
  • Star Topology: All devices connect to a central node (Hub or Switch). If a single cable fails, only that node goes down; if the central node fails, the whole network goes down.
  • Ring Topology: Each device is connected to exactly two other devices, forming a closed loop. Data travels in one direction (unidirectional) or both (bidirectional).
  • Mesh Topology: Every device is connected to every other device (Full Mesh) or multiple devices (Partial Mesh). Offers the highest redundancy and reliability but is expensive to wire.
  • Tree Topology: A hierarchical combination of Bus and Star topologies. Used in large corporate networks.

Network Devices

  • Hub: A physical layer device that broadcasts incoming data to all its ports, regardless of the destination. It is "dumb" and cannot filter data, leading to high collision rates.
  • Switch: A data-link layer device that connects devices within a LAN. It uses MAC addresses to forward data only to the specific destination port, greatly reducing collisions and improving efficiency.
  • Router: A network layer device that connects different networks (e.g., a LAN to a WAN) and routes data packets based on IP addresses. It determines the shortest/best path for data using routing tables.
  • Repeater: Regenerates weak electrical signals to extend the transmission distance over the physical media.
  • Bridge: Connects two separate LAN segments and filters traffic based on MAC addresses to reduce congestion.

5. Introduction to Packets

Data sent across a computer network is not transmitted as a single continuous stream. Instead, it is broken down into smaller, manageable chunks called Packets.

Structure of a Packet:

  1. Header: Contains control information required for routing and delivery. Includes source and destination IP addresses, sequence numbers, and protocol types.
  2. Payload (Data): The actual information or message being transmitted.
  3. Trailer (Footer): Typically contains an error-checking mechanism like the Frame Check Sequence (FCS) or Cyclic Redundancy Check (CRC) to ensure data integrity.

Benefits of Packet Switching: Efficient use of bandwidth, high fault tolerance (packets can take different routes if a link goes down), and fair resource allocation.


6. IP Address and MAC Address

MAC Address (Media Access Control)

  • Definition: A unique, physical hardware address burnt into the Network Interface Card (NIC) by the manufacturer.
  • Layer: Data Link Layer (Layer 2).
  • Format: 48-bit (6-byte) hexadecimal number. Example: 00:1A:2B:3C:4D:5E.
  • Function: Used for local communication within the same LAN. It does not change if the device moves to a different network.

IP Address (Internet Protocol)

  • Definition: A logical address assigned to a device connected to a computer network that uses the Internet Protocol for communication.
  • Layer: Network Layer (Layer 3).
  • Format:
    • IPv4: 32-bit address, represented in dotted-decimal format (e.g., 192.168.1.10).
    • IPv6: 128-bit address, represented in hexadecimal format (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
  • Function: Used for global routing across different networks. It changes depending on the network the device is connected to.

7. Network Models

Network models define a standard architecture for network communication, allowing different vendors' hardware and software to interoperate.

The OSI Model (Open Systems Interconnection)

A conceptual framework standardized by the ISO consisting of 7 distinct layers.

  1. Physical Layer: Handles the transmission of raw bit streams (0s and 1s) over a physical medium. Defines voltage levels, pinouts, and cabling.
  2. Data Link Layer: Provides node-to-node data transfer. Handles framing, physical addressing (MAC), error detection (FCS), and flow control. Consists of two sublayers: MAC and LLC.
  3. Network Layer: Responsible for routing packets between different networks and logical addressing (IP).
  4. Transport Layer: Ensures reliable, end-to-end delivery of entire messages. Handles segmentation, connection multiplexing, and often error recovery (TCP) or best-effort delivery (UDP).
  5. Session Layer: Establishes, maintains, and synchronizes communication sessions between applications.
  6. Presentation Layer: Translates data between the application and network formats. Handles data encryption, decryption, and compression (e.g., JPEG, ASCII, TLS).
  7. Application Layer: The interface directly interacting with the user's software application. Provides network services like email, file transfer, and web browsing (HTTP, FTP, SMTP).

TCP/IP Protocol Suite

The practical, implemented model upon which the modern Internet is based. It condenses the OSI model into 4 layers.

  1. Network Access Layer (Link Layer): Corresponds to the OSI Physical and Data Link layers. Deals with MAC addresses, Ethernet, Wi-Fi, and physical transmission.
  2. Internet Layer: Corresponds to the OSI Network layer. Handles logical addressing and routing. Core Protocols: IP, ICMP, ARP.
  3. Transport Layer: Corresponds to the OSI Transport layer. Handles host-to-host communication. Core Protocols: TCP (Transmission Control Protocol - reliable), UDP (User Datagram Protocol - fast/unreliable).
  4. Application Layer: Combines OSI Session, Presentation, and Application layers. Contains all higher-level protocols. Core Protocols: HTTP, HTTPS, DNS, FTP, SMTP, SSH.

Summary Comparison:

  • OSI is a theoretical reference model; TCP/IP is an implementation-based client-server model.
  • OSI has strictly defined layers and boundaries, making it useful for teaching and troubleshooting.
  • TCP/IP is more flexible and is the actual standard used for global internet communication.