Comprehensive Study Guide: Data Communications and Networking

Fundamentals of Data Communications

  • Definition: Data communications are the exchange of data between two devices via some form of transmission medium such as a wire cable.
  • System Composition: Communicating devices must be part of a communication system made up of a combination of hardware (physical equipment) and software (programs).
  • Core Effectiveness Characteristics:
    • Delivery: The system must deliver data to the correct destination. Data must be received by the intended device or user and only by that device or user.
    • Accuracy: The system must deliver data accurately. Data that have been altered in transmission and left uncorrected are unusable.
    • Timeliness: The system must deliver data in a timely manner. Late data are useless. Real-time transmission refers to delivering data as they are produced, in the same order, and without significant delay (crucial for audio and video).
    • Jitter: Jitter refers to the variation in packet arrival time. It is the uneven delay in the delivery of audio or video packets. For example, if video packets are sent every 30 ms30\,\text{ms}, and some arrive with 30 ms30\,\text{ms} delay while others arrive with 40 ms40\,\text{ms} delay, an uneven quality in video results.
  • Five Components of a Data Communication System:
    1. Message: The information (data) to be communicated. Common forms include text, numbers, pictures, audio, and video.
    2. Sender: The device that sends the data message (e.g., computer, workstation, telephone handset, video camera).
    3. Receiver: The device that receives the message (e.g., computer, workstation, telephone handset, television).
    4. Transmission Medium: The physical path by which a message travels from sender to receiver (e.g., twisted-pair wire, coaxial cable, fiber-optic cable, radio waves).
    5. Protocol: A set of rules that govern data communications. It represents an agreement between communicating devices. Without a protocol, two devices may be connected but cannot communicate.

Components of a Data Communication System

Data Representation Techniques

  • Text:
    • Represented as a bit pattern (a sequence of 00s or 11s).
    • Code refers to sets of bit patterns designed to represent text symbols; the process is called coding.
    • Unicode is the prevalent coding system today, using 3232 bits to represent a symbol or character used in any language in the world.
  • Numbers:
    • Represented by bit patterns.
    • Numbers are directly converted to binary numbers rather than using character codes (such as ASCII) to simplify mathematical operations.
  • Images:
    • Represented by bit patterns as a matrix of pixels (picture elements), where each pixel is a small dot.
    • Resolution determines pixel size (e.g., dividing an image into 10,00010{,}000 pixels rather than 1,0001{,}000 pixels gives better resolution but requires more memory).
    • Each pixel is assigned a bit pattern: black-and-white images require only a 11-bit pattern per pixel.
    • Color images use methods like RGB, where each color is formed by combining primary colors red, green, and blue.
  • Audio:
    • Continuous (analog), non-discrete recording or broadcasting of sound or music.
    • Microphones transform voice or music into continuous electric signals.
  • Video:
    • Recording or broadcasting of a picture or movie.
    • Can be produced as a continuous entity (e.g., by a TV camera) or as a combination of discrete images/frames arranged to convey motion.

Data Flow Directions

  • Simplex Mode:
    • Unidirectional communication (like a one-way street).
    • Only one device on a link can transmit; the other can only receive.
    • Utilizes the entire capacity of the channel to send data in one direction.
    • Examples: Keyboards (input only) and traditional monitors (output only).
  • Half-Duplex Mode:
    • Each station can both transmit and receive, but not at the same time.
    • When one device is sending, the other can only receive.
    • The entire capacity of the channel is taken over by whichever device is transmitting at the time.
    • Examples: Walkie-talkies and CB (citizens band) radios.
  • Full-Duplex Mode (Duplex):
    • Both stations can transmit and receive simultaneously.
    • Signals going in opposite directions share the capacity of the link.
    • Channel sharing is achieved by having two physically separate transmission paths or by dividing the overall channel capacity between signals traveling in both directions.
    • Example: Telephone networks.

Data Flow Modes: Simplex, Half-duplex, Full-duplex

Computer Network Fundamentals

  • Network Definition: A set of devices (nodes) connected by communication links. A node can be a computer, printer, or any device capable of sending and/or receiving data generated by other nodes.
  • Distributed Processing: A design where a task is divided among multiple computers (e.g., personal computers or workstations) handling subsets, rather than relying on a single large central machine.
  • Core Network Criteria:
    • Performance:
    • Measured by transit time (time required for a message to travel from one device to another) and response time (elapsed time between an inquiry and a response).
    • Dependent on user count, transmission medium, hardware capabilities, and software efficiency.
    • Evaluated by two main metrics: throughput (needs to be maximized) and delay (needs to be minimized).
    • Reliability:
    • Measured by delivery accuracy, frequency of failure, link recovery time from failure, and robustness during catastrophes.
    • Security:
    • Includes protecting data from unauthorized access, preventing damage and alteration, and establishing policies and procedures for recovery from breaches and data loss.

Connection Types and Physical Topologies

  • Types of Connections:
    • Point-to-Point: Provides a dedicated link between two devices. The entire capacity of the link is reserved for transmission between those two devices (uses physical wires/cables, microwave, or satellite links).
    • Multipoint (Multidrop): More than two specific devices share a single link.
    • Spatially Shared: Multiple devices use the link simultaneously.
    • Timeshared: Devices take turns using the link.

Point-to-point Connection

Multipoint Connection

  • Physical Topology: Geometric representation of the layout of links and nodes connecting to one another.

Taxonomy of Network Topologies

Mesh Topology

  • Every device has a dedicated point-to-point link to every other device.
  • Link Count Formula: For a fully connected mesh network with nn nodes, each node connects to n−1n - 1 nodes, requiring n(n−1)n(n - 1) physical links. For duplex-mode communication: Physical Duplex Links=n(n−1)2\text{Physical Duplex Links} = \frac{n(n - 1)}{2}
  • Advantages:
    1. Dedicated links guarantee capacity and eliminate shared traffic congestion.
    2. High robustness: if one link fails, the rest of the system remains operational.
    3. High privacy and security: messages travel along dedicated lines to the intended recipient only.
    4. Easy fault identification and isolation for re-routing traffic.
  • Disadvantages:
    1. Installation and reconnection are complex due to the sheer volume of cabling.
    2. Cable bulk can exceed available physical spatial capacity.
    3. Hardware costs (I/O ports and cables) can be prohibitively expensive.
  • Usually implemented in limited scope as a backbone connecting main computers in hybrid networks.

Mesh Topology

Star Topology

  • Each device has a dedicated point-to-point link only to a central controller called a hub.
  • Direct traffic between devices is not allowed; the hub acts as a central exchange relaying messages.
  • Advantages:
    1. Less expensive than mesh (11 link and 11 I/O port per device).
    2. Easy to install, reconfigure, and route cabling.
    3. High robustness: failure of one link leaves all other links active.
    4. Easy fault identification and central link monitoring.
  • Disadvantages:
    1. Single point of failure: if the central hub fails, the entire network fails.
    2. Requires more cabling than bus or ring topologies because every node must run to the central hub.

Star Topology

Bus Topology

  • Multipoint layout where one long central cable acts as a backbone linking all devices.
  • Nodes attach via drop lines (flexible cables running to the main backbone) and taps (connectors splicing into or puncturing the outer sheath to touch the metallic core).
  • Signal energy degrades into heat as it travels; limits exist on maximum distance and supported tap count.
  • Advantages:
    1. Ease of installation and minimal cabling relative to mesh or star.
    2. Eliminates cabling redundancy.
  • Disadvantages:
    1. Reconnection and fault isolation are difficult.
    2. Signal reflection at taps causes noise and signal degradation.
    3. A fault or break in the main backbone stops all transmissions and reflects signals in both directions.

Bus Topology

Ring Topology

  • Each device has a dedicated point-to-point link with only the two devices on either side of it.
  • Signals pass unidirectionally along the ring node-by-node.
  • Each device incorporates a repeater to regenerate bits before passing them along.
  • Advantages:
    1. Easy installation and reconfiguration (only 22 connections modified per added/removed station).
    2. Simplified fault isolation: stations issue an alarm if a signal is not received within a set duration.
  • Disadvantages:
    1. Unidirectional traffic vulnerability: a single break or disabled node can disrupt the whole network (mitigated by dual rings or automated ring switches).

Ring Topology

Hybrid Topology

  • Combines multiple basic topologies into a unified structure (e.g., a primary star topology backbone with branches connecting nodes in a bus topology).

Hybrid Topology

Network Classifications

  • Local Area Network (LAN):
    • Privately owned, connecting devices across a single office, building, or campus.
    • Maximum physical size is typically limited to a few kilometers.
    • Enables resource sharing (printers, application software, data).
    • Common layout involves workstations accessing a central server host equipped with large storage capacity.
    • Uses single transmission medium types in bus, ring, or star configurations.

Local Area Network Structure

  • Wide Area Network (WAN):
    • Long-distance data, image, audio, and video transmission across cities, countries, continents, or the globe.
    • Switched WAN: Connects end systems via routers across complex network backbones.
    • Point-to-Point WAN: Leased line connecting a individual computer or LAN to an Internet Service Provider (ISP).

Switched WAN and Point-to-point WAN

  • Metropolitan Area Network (MAN):
    • Intermediate size between LAN and WAN, covering a town or city.
    • Provides high-speed connectivity to users across urban regions (e.g., telephone company DSL connections).
  • Internetwork (Internet):
    • Formed when two or more independent networks (LANs, MANs, WANs) are joined together.
    • Example: Connecting a bus LAN office, a star LAN office, and a remote home workstation via a switched backbone WAN and leased point-to-point WAN lines (DSL/cable).

An Internetwork Architecture

Principles of Protocol Layering

  • Protocol Definition: Rules governing senders, receivers, and intermediate devices for effective communication.
  • Single-Layer Scenario: Direct face-to-face interaction (e.g., Maria and Ann conversing). Rules govern greetings, shared vocabulary level, taking turns speaking, maintaining a dialogue, and concluding gracefully.

Single-layer Communication Protocol

  • Three-Layer Scenario: Complex postal interaction across distance.
    • Layer 3: Plaintext message creation/reading (Talk/Listen).
    • Layer 2: Encryption and decryption (Plaintext ↔\leftrightarrow Ciphertext).
    • Layer 1: Physical mail delivery handling (Enveloping, addressing, postal carrier delivery).

Three-layer Communication Protocol

  • Two Fundamental Principles of Protocol Layering:
    1. First Principle: For bidirectional communication, each layer must perform two opposite tasks, one in each direction (e.g., listen/talk, encrypt/decrypt, send/receive).
    2. Second Principle: The two objects under each layer at both sites must be identical (e.g., Layer 3 handles plaintext at both sites; Layer 2 handles ciphertext at both sites; Layer 1 handles physical mail envelopes at both sites).
  • Logical Connections: Direct peer-to-peer logical layer abstraction between corresponding layers at source and destination sites.

Logical Connections Between Peer Layers

The TCP/IP Protocol Suite

  • Overview: A hierarchical suite of interactive modules organized into layers, where higher-level protocols are supported by lower-level protocol services.
  • The 5-Layer Model:
    1. Application Layer (Layer 5)
    2. Transport Layer (Layer 4)
    3. Network Layer (Layer 3)
    4. Data-Link Layer (Layer 2)
    5. Physical Layer (Layer 1)

Layers in the TCP/IP Protocol Suite

  • Device Layer Involvement Across an Internet:
    • Hosts (Source/Destination): Implement all 5 layers.
    • Routers: Implement 3 layers (Network, Data-Link, Physical). Operates with nn combinations of Data-Link and Physical layers for nn attached links.
    • Link-Layer Switches: Implement 2 layers (Data-Link and Physical).
    • Service Scope: Application, Transport, and Network layers operate end-to-end; Data-Link and Physical layers operate hop-to-hop.

Communication Through an Internet

Layer Functions in TCP/IP

  • Physical Layer:
    • Carries individual bits within a frame across physical media (cables, air).
    • Transforms logical bits into physical electrical or optical signals.
  • Data-Link Layer:
    • Responsible for taking a datagram and moving it across a specific individual link.
    • Encapsulates network datagrams into packets called frames.
    • Supports standard and proprietary protocols across wired LANs, wireless LANs, wired WANs, and wireless WANs.
  • Network Layer:
    • Responsible for host-to-host connection and choosing the best route for packets across routers.
    • Internet Protocol (IP): Core connectionless protocol defining datagram formats, addressing structures, and routing. Provides no flow, error, or congestion control.
    • Auxiliary Network Protocols:
    • ICMP (Internet Control Message Protocol): Reports routing errors and problems.
    • IGMP (Internet Group Management Protocol): Facilitates multicast group management.
    • DHCP (Dynamic Host Configuration Protocol): Dynamically assigns network-layer addresses to hosts.
    • ARP (Address Resolution Protocol): Maps a known network-layer IP address to its corresponding physical link-layer MAC address.
  • Transport Layer:
    • Responsible for process-to-process delivery of messages from source application to destination application.
    • TCP (Transmission Control Protocol): Connection-oriented. Establishes a logical pipe, providing flow control, error control (retransmission of corrupted segments), and congestion control. Packet unit is called a segment.
    • UDP (User Datagram Protocol): Connectionless, simple, low-overhead protocol without flow, error, or congestion control. Packet unit is called a user datagram.
    • SCTP (Stream Control Transmission Protocol): Designed for emerging multimedia applications.
  • Application Layer:
    • Process-to-process exchange of messages.
    • Key Standard Protocols:
    • HTTP: HyperText Transfer Protocol for Web access.
    • SMTP: Simple Mail Transfer Protocol for electronic mail.
    • FTP: File Transfer Protocol for file movement.
    • TELNET / SSH: Terminal Network and Secure Shell for remote access.
    • SNMP: Simple Network Management Protocol for network management.
    • DNS: Domain Name System for resolving hostnames to IP addresses.

Encapsulation, Decapsulation, and Layer Addressing

  • Encapsulation at Source Host:
    • Application: Prepares message.
    • Transport: Wraps message payload with transport header containing source/destination program identifiers →\rightarrow Segment (TCP) / User Datagram (UDP).
    • Network: Wraps transport packet payload with network header containing source/destination IP addresses, checksums, fragmentation data $ ightarrow$ Datagram.
    • Data-Link: Wraps datagram payload with link-layer header containing physical hop MAC addresses $ ightarrow$ Frame.
    • Physical: Converts frame into electrical/optical signal bits.
  • Decapsulation & Encapsulation at Router:
    • Physical layer receives signals →\rightarrow Data-link layer decapsulates frame to datagram $ ightarrow$ Network layer inspects destination IP address, checks forwarding table, re-fragments if needed $ ightarrow$ Next link Data-link layer encapsulates datagram into new frame $ ightarrow$ Physical layer transmits.
  • Layer Addressing Scheme:
    • Application Layer: Names (e.g., domain names, email addresses, URLs).
    • Transport Layer: Port numbers (1616-bit local integers identifying distinct host processes).
    • Network Layer: Logical addresses / IP addresses (global scope, defining host network connection).
    • Data-Link Layer: Link-layer / MAC addresses (locally defined physical node addresses).
    • Physical Layer: No addresses used (operates purely on raw bit streams).

Addressing in the TCP/IP Protocol Suite

The OSI Model Comparison

  • OSI (Open Systems Interconnection): A 77-layer theoretical reference framework created by the International Organization for Standardization (ISO).
    • Layer 7: Application
    • Layer 6: Presentation
    • Layer 5: Session
    • Layer 4: Transport
    • Layer 3: Network
    • Layer 2: Data Link
    • Layer 1: Physical

The OSI 7-Layer Reference Model

  • TCP/IP vs. OSI Model:
    • OSI contains Session and Presentation layers absent from the explicit TCP/IP architecture.
    • Session functions are partially embedded in TCP/IP transport protocols (e.g., TCP).
    • Presentation functions are handled directly within individual application layer protocols.

Comparison of TCP/IP Suite and OSI Model

World Wide Web (WWW) and HTTP

  • WWW Architecture: Distributed client-server repository where hyperlinked documents (web pages) are stored across global server sites.

Web Page Request and Response Example

  • Web Client (Browser): Interprets and displays web pages using three components: Controller, Client Protocols (HTTP, FTP, SSH, SMTP), and Interpreters (HTML, JavaScript, Java).

Browser Architecture and Component Interactions

  • Web Server: Stores web pages; utilizes in-memory caches to speed document retrieval over disk access.
  • Uniform Resource Locator (URL): Unique page identifier containing four components:
    • Protocol: Client-server application protocol (e.g., http).
    • Host: IP address or domain name (e.g., forouzan.com).
    • Port: Predefined integer (default HTTP port is 8080).
    • Path: Directory location and filename in the server host operating system (e.g., /top/next/last/myfile).
  • HTTP Connection Modes:
    • Nonpersistent Connection: Opens a new TCP connection for every single request/response pair.
    1. Client opens TCP connection and sends request.
    2. Server sends response and closes connection.
    3. Client reads data to end-of-file marker and closes connection.

Nonpersistent HTTP Connection Exchange

  • Persistent Connection (HTTP/1.1): Keeps TCP connection open across multiple requests/responses until closed explicitly or timed out, saving connection setup overhead.

Persistent HTTP Connection Exchange

  • HTTP Message Structures:
    • Request line / Status line followed by Header lines, Blank line (CR LF), and optional Message Body.

HTTP Request and Response Message Structure

  • HTTP Request Methods:
    • GET: Requests document/file (empty body).
    • HEAD: Requests header metadata only (e.g., last modification date).
    • PUT: Uploads/posts new web page.
    • POST: Sends input data to append/modify server pages.
    • TRACE: Echoes request back for debugging.
    • DELETE: Deletes target file on server.
    • CONNECT: Reserved for proxy server usage.
    • OPTIONS: Queries web page configuration/properties.
  • HTTP Response Headers:

HTTP Response Headers List

Domain Name System (DNS)

  • Function: Directory lookup system translating human-readable hostnames into network IP addresses.
  • Six-Step Resolution Process:
    1. User passes hostname to file transfer client application.
    2. File transfer client passes hostname to local DNS client.
    3. DNS client queries known DNS server using its stored IP address.
    4. DNS server returns the requested host IP address in response.
    5. DNS client forwards IP address to file transfer client.
    6. File transfer client connects directly to file transfer server using IP address.

DNS Name Resolution Process

  • Name Space & Hierarchy:
    • Hierarchical Domain Name Space: Structured as an inverted tree with the root node at the top.
    • Domain: A specific subtree within the domain name space, named after its top node.

Inverted Tree Structure of Domain Name Space

Hierarchy and Distribution of Domains

  • DNS Message Layout:
    • Header containing Identification, Flags, Question Record Count, Answer Record Count, Authoritative Record Count, Additional Record Count.
    • Followed by Question, Answer, Authoritative, and Additional sections.

DNS Message Structure

  • DNS Security Threats:
    1. Eavesdropping / User Profiling: Intercepting queries to compile user behavioral profiles (Requires message confidentiality).
    2. Response Spoofing / Interception: Injecting fake DNS responses to redirect traffic to malicious sites (Requires origin authentication and integrity protection).
    3. Denial of Service (DoS): Overwhelming DNS servers with traffic floods (Requires DoS mitigation controls).

Simple Network Management Protocol (SNMP)

  • Purpose: Framework for device monitoring and management across TCP/IP networks.
  • Manager and Agent Architecture:
    • Manager: Central management station running SNMP client program.
    • Agent: Managed router or host running SNMP server program maintaining variable state databases.
    • Three Core Actions:
    1. Manager queries agent variable values to monitor status.
    2. Manager resets agent database variable values to enforce actions.
    3. Agent sends unsolicited warnings (traps) to alert manager of abnormal events.

SNMP Manager and Agent Interaction

  • Management Components:
    • SNMP: Defines packet exchange formats to read and write managed variable values.
    • SMI (Structure of Management Information): Defines general rules for naming objects, data types, ranges, lengths, and encoding schemes.
    • MIB (Management Information Base): Collection database of named object types and relationships maintained within each managed entity.

Network Management Components: SNMP, SMI, and MIB

Mapping Network Management to Computer Programming