UNIT 1: FOUNDATIONS OF DATA COMMUNICATION & NETWORKING BASICS
1.1 Introduction to Data Communication & Networking
1.1.1 Definition and Core Components
-
Data Communication: The exchange of digital data between two or more devices.
-
Core Components:
-
Sender (Source): Originates the message/data.
-
Receiver (Destination): Intended recipient of the message.
-
Medium (Channel): Physical path (cable, fiber, air) for signal transmission.
-
Protocol: Set of rules governing data exchange (format, timing, error handling). Ensures devices can understand each other.
-
1.1.2 Types of Networks (by geographical scale)
| Acronym | Full Name | Typical Range | Primary Use Case |
|---|---|---|---|
| PAN | Personal Area Network | ~10 meters | Connecting personal devices (e.g., Bluetooth, USB) |
| LAN | Local Area Network | Building/Campus | Office, home, school networks (Ethernet, Wi-Fi) |
| MAN | Metropolitan Area Network | City | City-wide connectivity (e.g., cable TV network) |
| WAN | Wide Area Network | Country/Globe | Connecting distant LANs (e.g., Internet, leased lines) |
1.1.3 Network Topologies
-
Bus: All devices share a single central cable. Simple but prone to failure if main cable breaks.
-
Star: All devices connect to a central hub/switch. Easy to manage, failure of one link doesn't affect others.
-
Ring: Devices form a closed loop. Data travels in one direction. Failure can break the ring.
-
Mesh: Every device has a dedicated link to every other device. Highly reliable but expensive (full mesh).
-
Hybrid: Combination of two or more topologies (e.g., star-bus).
1.1.4 Key Performance Metrics
-
Bandwidth: Maximum theoretical data transfer rate of a medium (Hz for analog, bps for digital).
-
Throughput: Actual achieved data transfer rate (always ≤ Bandwidth due to overhead, congestion).
-
Latency (Delay): Time taken for a bit/packet to travel from source to destination.
-
Jitter: Variation in packet delay. Critical for real-time applications (VoIP, video).
-
Reliability: Measure of success in delivering data (often tied to error rate).
[!TIP] Exam Distinction: Bandwidth is capacity (like a highway's lanes). Throughput is actual flow (like the number of cars moving per hour).
1.2 Networking Models: OSI & TCP/IP
1.2.1 OSI Seven-Layer Model (Functions)
| Layer | Name | Primary Function | Protocol Data Unit (PDU) |
|---|---|---|---|
| 7 | Application | User interface & network services (HTTP, FTP, SMTP) | Data |
| 6 | Presentation | Data translation, encryption, compression (SSL/TLS) | Data |
| 5 | Session | Establishes, manages, terminates sessions | Data |
| 4 | Transport | End-to-end connection, reliability, flow control (TCP/UDP) | Segment (TCP) / Datagram (UDP) |
| 3 | Network | Logical addressing & path determination (IP, ICMP) | Packet |
| 2 | Data Link | Framing, physical addressing, error detection (Ethernet, PPP) | Frame |
| 1 | Physical | Bit transmission over medium (voltage, light, radio) | Bits |
1.2.2 TCP/IP Four/Five-Layer Model
-
Four-Layer Model:
-
Application Layer (Combines OSI L5,6,7)
-
Transport Layer (OSI L4)
-
Internet Layer (OSI L3) - Core protocol: IP
-
Network Access/Link Layer (Combines OSI L1,2)
-
-
Correspondence: TCP/IP is a practical implementation model; OSI is a theoretical reference model.
1.2.3 Encapsulation & De-encapsulation
Process of adding headers (and sometimes trailers) as data moves down the OSI layers at the sender, and stripping them off as it moves up at the receiver.
Sender Side (Encapsulation):
Application Data
↓ [Transport Header] → Segment
↓ [Network Header] → Packet
↓ [Data Link Header/Trailer] → Frame
↓ [Physical Encoding] → Bits on Wire
Receiver Side (De-encapsulation):
Bits on Wire
↑ [Physical Decoding] → Frame
↑ [Remove Data Link Header/Trailer] → Packet
↑ [Remove Network Header] → Segment
↑ [Remove Transport Header] → Application Data
1.2.4 Layer-wise Addressing
-
Layer 1 (Physical): No address. Defines electrical/optical specs.
-
Layer 2 (Data Link): MAC Address (48-bit, burned into NIC, used for local delivery).
-
Layer 3 (Network): IP Address (32-bit in IPv4, logical, used for global routing).
-
Layer 4 (Transport): Port Number (16-bit, identifies specific application/service on a host).
1.3 Physical Layer & Transmission Media
1.3.1 Role of the Physical Layer
-
Defines mechanical, electrical, functional, and procedural specifications for activating, maintaining, and deactivating the physical link.
-
Specifies: bit rate, transmission mode (simplex/half/full-duplex), physical topologies, interface (connector) types.
1.3.2 Guided Media (Wired)
| Media | Type | Characteristics | Max Distance (Typical) |
|---|---|---|---|
| Twisted Pair | UTP (Unshielded) | 4 pairs, RJ-45, susceptible to EMI, cheap. (Cat5e/6) | 100m (Ethernet) |
| STP (Shielded) | Has foil shield, better EMI protection, more expensive. | 100m | |
| Coaxial Cable | Thicknet (10BASE5) | Rigid, high bandwidth, hard to install. | 500m |
| Thinnet (10BASE2) | Flexible, easier, uses BNC connectors. | 185m | |
| Fiber Optic | Single-mode | Small core (9µm), laser light, long distance, high cost. | ~100 km |
| Multi-mode | Larger core (50/62.5µm), LED light, shorter distance, cheaper. | ~2 km |
1.3.3 Unguided Media (Wireless)
-
Radio Waves: Omnidirectional, penetrate walls, used in Wi-Fi, Bluetooth.
-
Microwaves: Directional, line-of-sight, used in satellite, point-to-point links.
-
Infrared: Short range, line-of-sight, used in remote controls, IrDA.
1.3.4 Connectors and Interfaces
-
RJ-45: 8-pin modular connector for twisted pair (Ethernet).
-
BNC: Bayonet-style connector for coaxial cable (older Ethernet, CCTV).
-
SC/ST: Push-pull (SC) or bayonet (ST) connectors for fiber optic cables.
-
USB: Universal Serial Bus for peripheral connection (not typically for networking).
1.3.5 Concept of Signal
-
Analog vs. Digital:
-
Analog: Continuous wave (e.g., voice, traditional radio).
-
Digital: Discrete pulses (0s and 1s). More robust to noise.
-
-
Baseband vs. Broadband:
-
Baseband: Single channel, digital signal occupies full bandwidth of medium (e.g., Ethernet). Requires repeaters to regenerate signal.
-
Broadband: Multiple channels, analog signal modulated onto different frequencies (e.g., cable TV, DSL). Allows simultaneous send/receive.
-
1.4 Network Interface Hardware & Cabling
1.4.1 Network Interface Card (NIC)
-
Function: Connects a computer to the network medium. Implements physical and data link layer logic.
-
MAC Address: Unique 48-bit (6-byte) hardware identifier burned into the NIC ROM. Format:
AA:BB:CC:DD:EE:FF(hexadecimal). Globally unique.
1.4.2 Repeaters, Hubs (Physical Layer Devices)
-
Repeater: Regenerates and retimes analog/digital signals to extend cable length.
-
Hub: Multiport repeater. Broadcasts incoming signal to all other ports. No intelligence, operates at Layer 1. Creates a single collision domain.
1.4.3 Ethernet Standards (Physical Layer)
| Standard | Speed | Media | Max Segment Length |
|---|---|---|---|
| 10BASE-T | 10 Mbps | Twisted Pair (Cat3+) | 100m |
| 100BASE-TX | 100 Mbps | Twisted Pair (Cat5) | 100m |
| 1000BASE-T | 1 Gbps | Twisted Pair (Cat5e/6) | 100m |
1.4.4 Practical: Identifying and Using Cables
-
Straight-through Cable: Pinout is identical on both ends (T568A on both or T568B on both). Used to connect dissimilar devices: PC ↔ Switch, Switch ↔ Router.
-
Crossover Cable: One end T568A, other end T568B. Used to connect similar devices: PC ↔ PC, Switch ↔ Switch, Router ↔ Router (older devices).
-
Rollover Cable: Pin 1 ↔ Pin 8, Pin 2 ↔ Pin 7, etc. Used for console connections to router/switch CLI.
1.4.5 Color Coding Standards (TIA/EIA 568)
-
T568A Pinout (from pin 1 to 8): White-Green, Green, White-Orange, Blue, White-Blue, Orange, White-Brown, Brown.
-
T568B Pinout (from pin 1 to 8): White-Orange, Orange, White-Green, Blue, White-Blue, Green, White-Brown, Brown.
-
Rule: Straight-through uses same standard on both ends. Crossover uses A on one end, B on the other.
1.5 Data Link Layer Fundamentals
1.5.1 Role and Sublayers: LLC & MAC
-
Role: Provides reliable data transfer across a single physical link. Responsible for framing, physical addressing, error detection, and flow control.
-
Sublayers:
-
LLC (Logical Link Control): Upper sublayer. Provides interface to network layer, handles flow/error control for single link. Independent of media.
-
MAC (Media Access Control): Lower sublayer. Controls how devices share the medium (e.g., CSMA/CD in Ethernet). Implements physical addressing (MAC).
-
1.5.2 MAC Address Structure and Format
-
48-bit (6-byte) address, written as 12 hexadecimal digits.
-
Format:
XX:XX:XX:XX:XX:XXorXXXX.XXXX.XXXX. -
First 3 bytes (24 bits): OUI (Organizationally Unique Identifier) assigned to manufacturer.
-
Last 3 bytes (24 bits): NIC-specific, assigned by manufacturer.
-
Bit Significance: The least significant bit (LSB) of the first byte indicates:
-
0= Unicast (individual) -
1= Multicast (group) -
All 1s = Broadcast (
FF:FF:FF:FF:FF:FF)
-
1.5.3 Framing: Purpose and Methods
-
Purpose: To delineate the beginning and end of a packet/frame for the receiver.
-
Methods:
-
Character/Byte Counting: Sender includes frame length in header. Receiver counts bytes. (Prone to error if count gets garbled).
-
Flag Bytes with Bit Stuffing: Special flag byte (e.g.,
01111110or0x7E) marks start/end. Bit Stuffing: Transmitter inserts a0after any sequence of five1s in data to avoid accidental flag pattern. Receiver removes the stuffed0.
-
1.5.4 Error Detection
-
Parity Check: Adds a single bit to make total number of
1s even (even parity) or odd (odd parity). Can only detect single-bit errors. -
Checksum: Sender adds 1's complement sum of data segments. Receiver recomputes and compares. Used in higher layers (e.g., TCP/IP header checksum).
-
CRC (Cyclic Redundancy Check): Most powerful & common in data link layer (Ethernet, Wi-Fi).
-
Treats data as a polynomial.
-
Divides by a predefined generator polynomial (e.g., CRC-32).
-
Remainder (CRC bits) is appended to frame as trailer (FCS - Frame Check Sequence).
-
Receiver performs same division; non-zero remainder indicates error.
\boxed{\text{Frame is accepted if } \frac{\text{Data + FCS}}{\text{Generator Polynomial}} \text{ remainder = 0}}
-
1.5.5 Flow Control & Error Control
-
Stop-and-Wait ARQ: Simplest. Sender sends one frame, stops and waits for ACK before sending next. Inefficient, high idle time.
-
Sliding Window Protocol: More efficient. Sender can transmit multiple frames before needing ACK.
-
Window Size: Number of frames sender can send without ACK.
-
Go-Back-N: Receiver discards all subsequent frames if one is lost/out-of-order. Sender retransmits from lost frame onward.
-
Selective Repeat: Receiver buffers out-of-order frames. Sender only retransmits specifically requested (NAK'd) frames.
-
1.6 Basic Network Configuration & Command Line Tools
1.6.1 IP Addressing Fundamentals: IPv4
-
Structure: 32-bit address, written in dotted-decimal notation (e.g.,
192.168.1.1). -
Network ID vs. Host ID: Determined by the Subnet Mask. Bits set to
1in mask = Network portion. -
Classes (Legacy, but foundational):
| Class | First Octet Range | Default Subnet Mask | Network/Host Bits | | :--- | :--- | :--- | :--- | | A | 1 - 126 |
255.0.0.0| Network: 8, Host: 24 | | B | 128 - 191 |255.255.0.0| Network: 16, Host: 16 | | C | 192 - 223 |255.255.255.0| Network: 24, Host: 8 |
1.6.2 Special IP Addresses
-
Network Address: All host bits
0(e.g.,192.168.1.0/24). Cannot be assigned to a host. -
Broadcast Address: All host bits
1(e.g.,192.168.1.255/24). Packet sent to all hosts in the network. -
Loopback Address:
127.0.0.1to127.255.255.254. Refers to the local host itself. Used for testing.
1.6.3 Practical: Configuring TCP/IP Settings on a Host
-
Parameters:
-
IP Address: Unique logical address.
-
Subnet Mask: Defines network portion.
-
Default Gateway: Router's IP for traffic destined outside the local subnet.
-
DNS Server: IP address for domain name resolution (e.g.,
8.8.8.8).
-
-
Method: Can be Static (manual) or Dynamic (via DHCP server).
1.6.4 Essential Command Line Utilities
| Command (Windows) | Command (Linux) | Purpose & Protocol |
|---|---|---|
ipconfig |
ifconfig / ip addr |
Display local TCP/IP configuration (IP, Mask, Gateway). |
ping |
ping |
Test reachability using ICMP Echo Request/Reply. |
tracert |
traceroute |
Trace route/path to destination, showing each hop (router). Uses ICMP TTL expiration. |
arp -a |
arp -n |
Display ARP cache (IP ↔ MAC mappings). |
netstat -an |
netstat -tunlp |
Display active connections, listening ports, and routing table. |
1.6.5 Introduction to DNS, DHCP
-
DNS (Domain Name System): Hierarchical, distributed database that maps domain names (e.g.,
google.com) to IP addresses. Uses UDP port 53. -
DHCP (Dynamic Host Configuration Protocol): Automatically assigns IP addresses, subnet masks, gateways, DNS servers to clients. Uses a client-server model (DORA: Discover, Offer, Request, Acknowledge).
1.7 Introduction to Network Analysis Tools
1.7.1 Purpose of Packet Sniffing/Analysis
-
Capture and decode raw network traffic.
-
Uses: Troubleshooting, performance analysis, security monitoring, protocol education, forensic analysis.
1.7.2 Wireshark GUI Overview
-
Capture: Start/stop capturing on a selected network interface. Requires proper permissions.
-
Filter: Apply display filters to isolate specific traffic (e.g.,
http,ip.addr==192.168.1.5). -
Follow TCP Stream: Reconstructs and displays the entire conversation of a TCP connection in a user-friendly format.
1.7.3 Capturing and Analyzing Basic Frames
-
Ethernet Frame: Contains source/dest MAC, EtherType (e.g.,
0x0800for IPv4). -
ARP Request/Reply:
Who has 192.168.1.1? Tell 192.168.1.100. Resolves IP to MAC. -
ICMP Echo Request/Reply: The packets generated by the
pingcommand. -
DNS Query/Response: Standard
Arecord lookup.
1.7.4 Basic Display Filters
-
eth.addr == aa:bb:cc:dd:ee:ff: Filter by MAC address. -
ip.addr == 192.168.1.1: Filter by IP address (source OR destination). -
icmp: Show only ICMP packets (ping, traceroute). -
dns: Show only DNS traffic. -
tcp.port == 80: Show HTTP traffic (port 80). -
arp: Show only ARP packets.
1.8 Initial Lab Exercises & Safety
1.8.1 Lab Safety Protocols
-
ESD (Electrostatic Discharge): Use anti-static wrist strap when handling internal components. Work on grounded mat.
-
Cable Handling: Do not sharply bend fiber optic cables (can break core). Use proper strain relief.
-
Power: Ensure devices are powered off before connecting/disconnecting cables. Be aware of PoE (Power over Ethernet) risks.
1.8.2 Building a Simple Peer-to-Peer Network
-
Connect two PCs using a crossover Ethernet cable (or a straight-through cable if NICs support Auto-MDI/MDIX).
-
On both PCs, manually assign static IP addresses in the same subnet (e.g., PC1:
192.168.1.1/24, PC2:192.168.1.2/24). -
Set the same subnet mask (
255.255.255.0). -
No default gateway needed for direct P2P communication.
-
Ensure both NICs are enabled.
1.8.3 Verifying Connectivity
-
On PC1, open command prompt and run:
ping 192.168.1.2. -
Expected Result: Replies received. Confirms Layer 3 (IP) connectivity.
-
On PC1, run:
arp -a. -
Expected Result: PC2's IP (
192.168.1.2) should be listed with PC2's MAC address. This confirms Layer 2 (ARP) resolution occurred.
1.8.4 Capturing and Identifying Packets in Wireshark
-
Start Wireshark capture on PC1's network interface.
-
From PC1,
ping 192.168.1.2(send 4 requests). -
Stop capture.
-
Apply filter:
icmporip.addr==192.168.1.2. -
Identify:
-
ARP Exchange (if not in cache): First, an ARP Request (broadcast) from PC1 asking "Who has 192.168.1.2?", followed by an ARP Reply (unicast) from PC2 with its MAC.
-
ICMP Exchange: Echo Request (ping) from PC1 → PC2, followed by Echo Reply from PC2 → PC1.
-