11.2 Data Communications, OSI Model & Protocols
Key Takeaways
- The ISO 7-Layer OSI Reference Model organizes network functions from Layer 1 Physical up to Layer 7 Application.
- Transmission Control Protocol (TCP) provides connection-oriented, reliable byte-stream transport with flow control, whereas UDP provides connectionless, low-overhead datagram transport.
- Cyclic Redundancy Check (CRC) utilizes polynomial binary division modulo-2 to detect burst transmission errors.
- IPv4 Classless Inter-Domain Routing (CIDR) notation defines network prefix length, where a /24 subnet mask (255.255.255.0) yields 254 usable host IP addresses.
- Data link ARQ protocols (Stop-and-Wait, Go-Back-N, Selective Repeat) manage frame retransmission to ensure error-free link delivery.
11.2 Data Communications, OSI Model & Protocols
Quick Answer: Modern data networks structure communication tasks into functional layers. Key concepts heavily tested on the PRC ECE board exam include the 7 layers of the OSI model, TCP vs. UDP protocol characteristics, Cyclic Redundancy Check (CRC) polynomial division modulo-2, Automatic Repeat Request (ARQ) flow control, and IPv4 CIDR subnetting math ($2^{32-n} - 2$ usable host addresses per subnet).
Introduction to Data Communications & Network Architectures
Data communications refers to the exchange of digitized information between two or more nodes via a transmission medium governed by agreed-upon communication rules designated as protocols. To reduce system complexity, modern networking protocols are organized as a vertical stack of functional layers, where each layer provides specific services to the layer immediately above it while hiding internal implementation details.
The OSI 7-Layer Reference Model
Promulgated by the International Organization for Standardization (ISO) in 1984 under standard ISO/IEC 7498-1, the Open Systems Interconnection (OSI) model defines a 7-layer framework for network intercommunication.
┌─────────────────────────────────────────────────────────────┐
│ Layer 7: Application (HTTP, FTP, SMTP, DNS, SSH) │
├─────────────────────────────────────────────────────────────┤
│ Layer 6: Presentation (Data Formatting, Encryption, JPEG) │
├─────────────────────────────────────────────────────────────┤
│ Layer 5: Session (Dialog Control, RPC, NetBIOS) │
├─────────────────────────────────────────────────────────────┤
│ Layer 4: Transport (TCP, UDP, Segment/Datagram Flow) │
├─────────────────────────────────────────────────────────────┤
│ Layer 3: Network (IPv4, IPv6, ICMP, OSPF - Routing) │
├─────────────────────────────────────────────────────────────┤
│ Layer 2: Data Link (Ethernet, MAC/LLC, Switches, CRC) │
├─────────────────────────────────────────────────────────────┤
│ Layer 1: Physical (RS-232, RJ-45, Cables, Bit Encoding) │
└─────────────────────────────────────────────────────────────┘
Functional Overview of the 7 Layers
- Layer 1 - Physical Layer: Transmits raw, unstructured bitstreams over physical mediums (copper wires, fiber optics, radio frequencies). Defines electrical voltage levels, bit timings, connector pinouts (e.g., RS-232, RJ-45), and physical data rates.
- Layer 2 - Data Link Layer: Handles physical node-to-node framing, Media Access Control (MAC) addressing, error detection via CRC, and link-level flow control. Divided into two sublayers: Logical Link Control (LLC) (IEEE 802.2) and Media Access Control (MAC) (IEEE 802.3 Ethernet).
- Layer 3 - Network Layer: Manages logical network addressing (IPv4/IPv6 addresses), packet routing across interconnected networks (routers), and packet fragmentation.
- Layer 4 - Transport Layer: Manages end-to-end process-to-process communication, connection establishment, error recovery, segment sequencing, and port addressing. Key protocols: TCP and UDP.
- Layer 5 - Session Layer: Establishes, maintains, synchronizes, and terminates session dialogs between endpoints (e.g., Remote Procedure Calls - RPC, NetBIOS).
- Layer 6 - Presentation Layer: Translates data formats between application syntax and standard wire network syntax. Handles data compression, character encoding (ASCII, Unicode), and encryption/decryption (SSL/TLS).
- Layer 7 - Application Layer: Provides direct network services to software applications (browsers, email clients). Examples: HTTP/HTTPS, FTP, SMTP, DNS, SNMP.
OSI Model vs. TCP/IP Architecture Comparison
While OSI serves as the formal theoretical reference model, the practical internet architecture is built upon the 4-layer (or 5-layer) TCP/IP Protocol Suite.
| OSI Model Layer | TCP/IP Architecture Layer | Core Protocols & Services |
|---|---|---|
| 7. Application <br> 6. Presentation <br> 5. Session | Application Layer | HTTP, HTTPS, FTP, SMTP, DNS, SSH, DHCP, SNMP |
| 4. Transport | Transport Layer | TCP, UDP, SCTP |
| 3. Network | Internet Layer | IPv4, IPv6, ICMP, ARP, OSPF, BGP |
| 2. Data Link <br> 1. Physical | Network Access Layer (or Link/Physical) | Ethernet (802.3), Wi-Fi (802.11), Frame Relay, PPP |
Transport Layer Protocols: TCP vs. UDP
The Transport Layer provides process-to-process data delivery using 16-bit Port Numbers (allowing $65,536$ distinct logical ports).
TCP 3-Way Handshake UDP Connectionless
Client Server Client Server
│ │ │ │
│──── SYN (Seq=x) ───────>│ │──── Datagram ──────────>│
│<─── SYN-ACK (Ack=x+1) ──│ │ (No Handshake/Ack) │
│──── ACK (Ack=y+1) ─────>│ │ │
Transmission Control Protocol (TCP)
- Connection-Oriented: Establishes a reliable connection using a 3-Way Handshake (
SYN$\rightarrow$SYN-ACK$\rightarrow$ACK). - Reliability: Guarantees ordered data delivery using sequence numbers, positive acknowledgments (
ACK), and automatic retransmission of lost segments. - Flow Control & Congestion Control: Implements a dynamic Sliding Window Protocol to prevent receiver buffer overflow and congestion window mechanisms (Slow Start, Congestion Avoidance).
- Header Size: 20 bytes minimum (up to 60 bytes with options).
User Datagram Protocol (UDP)
- Connectionless: Transmits independent datagrams without establishing prior connections or performing handshakes.
- Unreliable & Low Overhead: Provides no sequence numbering, no acknowledgments, and no retransmission. Unordered datagrams may be lost or duplicated.
- Header Size: Minimal 8-byte fixed header (Source Port, Destination Port, Length, Checksum).
- Use Cases: Real-time applications prioritizing speed over reliability: VoIP, video streaming, DNS queries, online gaming.
Error Detection & Control: CRC Polynomial Division
Cyclic Redundancy Check (CRC) is a powerful error-detecting mechanism operating at Layer 2. A block of data bits is treated as coefficients of a binary polynomial and divided modulo-2 by a agreed-upon generator polynomial $G(X)$.
Mathematical Principles
- Given an $k$-bit message polynomial $M(X)$ and an $(n+1)$-bit generator polynomial $G(X)$ of degree $n$.
- Append $n$ zero bits to the message stream ($M(X) \cdot X^n$).
- Divide $M(X) \cdot X^n$ by $G(X)$ using binary modulo-2 division (exclusive-OR / XOR operations without carry/borrow).
- The remainder $R(X)$ of length $n$ bits is appended to the message as the CRC checksum field.
- The receiver divides the received frame by $G(X)$. A remainder of zero indicates no errors occurred during transmission.
Step-by-Step CRC Calculation Example
Problem: Compute the 3-bit CRC remainder for a binary message $M = 110101$ using generator polynomial $G(X) = X^3 + X + 1$ (binary divisor
1011).Solution:
- Determine Generator Degree ($n$): $G(X) = 1X^3 + 0X^2 + 1X^1 + 1X^0 \rightarrow$ Divisor =
1011($n = 3$ bits).- Append $n=3$ Zeros to Message: Augmented Dividend =
110101000.- Perform Modulo-2 Division (XOR Subtraction):
111001 <-- Quotient (Discarded) ─────────────── 1011 ┘ 110101000 1011 ──── 1100 1011 ──── 1111 1011 ──── 1000 0000 ──── 1000 0000 ──── 1000 1011 ──── 011 <-- 3-Bit CRC Remainder R(X)
- Final Transmitted Frame: Transmitted bits = Message + CRC =
110101011.
Automatic Repeat Request (ARQ) Mechanisms
When a receiver detects a corrupted frame via CRC failure, ARQ protocols manage retransmission:
- Stop-and-Wait ARQ: Transmitter sends 1 frame and pauses, waiting for an
ACKbefore sending the next frame. Simple but inefficient over long propagation delay paths. - Go-Back-N ARQ: Transmitter sends multiple frames up to a window size $W$. If frame $k$ is lost or corrupted, receiver rejects all subsequent frames ($k+1, k+2, \dots$), forcing the transmitter to retransmit frame $k$ and all subsequent frames in the window.
- Selective Repeat ARQ: Transmitter retransmits only the specific missing or corrupted frame. Receiver maintains a buffer to store out-of-order frames. Most bandwidth-efficient method.
IPv4 Addressing & CIDR Subnetting Guide
An IPv4 address is a 32-bit binary number represented in dotted-decimal notation (four 8-bit octets separated by dots, e.g., 192.168.1.1).
Classless Inter-Domain Routing (CIDR)
CIDR notation appends a slash followed by the prefix length $n$ indicating how many leading bits constitute the Network ID (e.g., 192.168.1.0/24).
(Two addresses are reserved: the Network Address with all host bits set to 0, and the Directed Broadcast Address with all host bits set to 1).
Subnetting Reference Table
| CIDR Prefix | Subnet Mask | Total IPs | Usable Host IPs | Common Application |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN Network |
| /26 | 255.255.255.192 | 64 | 62 | Departmental Subnet |
| /27 | 255.255.255.224 | 32 | 30 | Small Subnet |
| /28 | 255.255.255.240 | 16 | 14 | Small Server Farm |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-Point WAN Link |
Step-by-Step Subnetting Calculation Example
Problem: Given the IP address
192.168.10.130/27, determine (a) the Subnet Mask, (b) the Network ID, (c) the Broadcast Address, and (d) the range of usable host IP addresses.Solution:
- Subnet Mask: /27 prefix means 27 ones followed by 5 zeros $\rightarrow$
11111111.11111111.11111111.11100000=255.255.255.224.- Block Size (Magic Number): $256 - 224 = 32$ (or $2^5 = 32$). Subnet multiples: 0, 32, 64, 96, 128, 160...
- Locate Subnet for Host IP .130: The host IP .130 lies between 128 and 159.
- Network ID:
192.168.10.128- Broadcast Address:
192.168.10.159(one less than next subnet 160)- Usable Host Range:
192.168.10.129to192.168.10.158(30 usable hosts).
Which layer of the OSI 7-Layer Reference Model is responsible for end-to-end process-to-process communication, port addressing, flow control, and error recovery via TCP or UDP?
A network engineer needs to configure a point-to-point serial WAN link between two routers. Which CIDR subnet mask provides exactly 2 usable host IP addresses without wasting address space?
During a CRC error detection check, what result at the receiver indicates that the transmitted frame was received cleanly without any single-bit or burst transmission errors?