Data Communications & Networks
OSI Model, TCP/IP, IP Addressing & Network Protocols
1. Data Communication Basics
Components of Data Communication
- Message: Information (data) to be communicated
- Sender: Device that sends the message
- Receiver: Device that receives the message
- Medium: Physical path (cable, air, fiber)
- Protocol: Rules governing communication
Data Flow Modes:
- Simplex: One direction only (TV broadcast)
- Half-duplex: Both directions, not simultaneous (walkie-talkie)
- Full-duplex: Both directions simultaneously (phone call)
Transmission Modes
Serial Transmission
Bits sent one after another over single channel
Used for long distances, cheaper
Parallel Transmission
Multiple bits sent simultaneously over multiple channels
Used for short distances, faster
Transmission Media
Guided (Wired) Media
- Twisted Pair: Cat5e (100 Mbps), Cat6 (1 Gbps), Cat6a (10 Gbps)
- Coaxial Cable: 50Ω (Ethernet), 75Ω (TV)
- Fiber Optic: Single-mode (long distance), Multi-mode (short distance)
Unguided (Wireless) Media
- Radio Waves: Wi-Fi (2.4/5/6 GHz), Bluetooth
- Microwaves: Satellite, point-to-point
- Infrared: Short range, line-of-sight
2. OSI Reference Model
Seven Layers
Layer Functions
Physical Layer
Bit transmission, encoding, signaling, connectors
Data Link Layer
Framing, MAC addressing, error detection, flow control
Network Layer
Logical addressing (IP), routing, fragmentation
Transport Layer
End-to-end delivery, segmentation, flow/error control
Session Layer
Session establishment, maintenance, termination
Presentation Layer
Data translation, encryption, compression
Application Layer
User interface, network services (email, file transfer)
Mnemonic
"Please Do Not Throw Sausage Pizza Away"
(Physical, Data Link, Network, Transport, Session, Presentation, Application)
3. TCP/IP Model
Four Layers
TCP vs UDP
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | Guaranteed delivery | Best effort |
| Ordering | Ordered delivery | No ordering |
| Flow Control | Yes (sliding window) | No |
| Error Checking | Yes, with retransmission | Optional checksum |
| Speed | Slower (overhead) | Faster |
| Use Cases | HTTP, FTP, Email | DNS, Streaming, Gaming |
TCP 3-Way Handshake
Connection established after 3-way handshake
4. IP Addressing
IPv4 Classes
| Class | First Octet | Default Mask | Networks | Hosts/Network |
|---|---|---|---|---|
| A | 1-126 | 255.0.0.0 (/8) | 128 | 16,777,214 |
| B | 128-191 | 255.255.0.0 (/16) | 16,384 | 65,534 |
| C | 192-223 | 255.255.255.0 (/24) | 2,097,152 | 254 |
| D | 224-239 | N/A | Multicast | |
| E | 240-255 | N/A | Reserved/Experimental | |
Private IP Ranges (RFC 1918)
Class A
10.0.0.0 - 10.255.255.255
/8 (10.0.0.0/8)
Class B
172.16.0.0 - 172.31.255.255
/12 (172.16.0.0/12)
Class C
192.168.0.0 - 192.168.255.255
/16 (192.168.0.0/16)
Special Addresses
- 127.0.0.0/8: Loopback (localhost)
- 0.0.0.0: Default route / "This network"
- 255.255.255.255: Limited broadcast
- 169.254.0.0/16: Link-local (APIPA)
Subnetting Basics
Key Formulas:
- Subnets = 2^n (n = borrowed bits)
- Hosts/subnet = 2^h - 2 (h = host bits)
- Block size = 256 - subnet mask octet value
Example: 192.168.1.0/26
- Subnet mask: 255.255.255.192
- Borrowed bits: 2 (from /24 to /26)
- Subnets: 2² = 4
- Hosts/subnet: 2⁶ - 2 = 62
- Block size: 256 - 192 = 64
- Subnets: .0, .64, .128, .192
IPv6 Overview
- Size: 128-bit address (vs IPv4's 32-bit)
- Format: 8 groups of 4 hex digits (2001:0db8:85a3:0000:0000:8a2e:0370:7334)
- Simplified: Leading zeros can be omitted, consecutive zeros = ::
- No broadcast: Uses multicast instead
- No NAT needed: Enough addresses for all devices
5. Network Devices & Topologies
Network Devices
Layer 1 Devices
Hub
Broadcasts to all ports, creates collision domain
Repeater
Amplifies/regenerates signal to extend range
Layer 2 Devices
Switch
Forwards frames based on MAC address, creates separate collision domains
Bridge
Connects network segments, learns MAC addresses
Layer 3 Devices
Router
Forwards packets based on IP address, connects different networks
Layer 3 Switch
Combines switching and routing capabilities
Other Devices
Firewall
Filters traffic based on rules (security)
Access Point
Provides wireless connectivity
Network Topologies
Bus
Single backbone cable, terminators at ends
+ Simple, cheap
- Single point of failure
Star
Central hub/switch, all devices connect to center
+ Easy to add/remove, isolates failures
- Hub is single point of failure
Ring
Each device connects to two neighbors
+ Predictable performance
- One failure breaks ring
Mesh
Every device connected to every other
+ Very reliable, redundant
- Expensive, complex
Tree (Hierarchical)
Stars connected to star backbone
+ Scalable, organized
- Root failure affects all
Hybrid
Combination of multiple topologies
+ Flexible
- Complex design
6. Routing & Switching
Routing Protocols
Interior Gateway Protocols (IGP)
RIP (Distance Vector)
Hop count metric, max 15 hops, slow convergence
OSPF (Link State)
Cost metric, faster convergence, scalable
EIGRP (Hybrid)
Cisco proprietary, uses bandwidth/delay
Exterior Gateway Protocols (EGP)
BGP (Path Vector)
Internet backbone, policy-based routing
AS path, next hop attributes
Switching Methods
Store-and-Forward
Receives entire frame, checks CRC, then forwards. Highest latency, catches errors.
Cut-Through
Forwards after reading destination MAC. Lowest latency, may forward errors.
Fragment-Free
Waits for first 64 bytes (collision window), then forwards. Balance of speed/reliability.
VLANs
Virtual LANs logically segment a physical network into separate broadcast domains.
- 802.1Q: VLAN tagging standard (adds 4-byte tag to frame)
- Native VLAN: Untagged traffic VLAN
- Trunk: Link carrying multiple VLANs
- Access Port: Single VLAN port
7. Common Protocols & Ports
Well-Known Ports
| Port | Protocol | Description |
|---|---|---|
| 20, 21 | FTP | File Transfer (Data, Control) |
| 22 | SSH | Secure Shell |
| 23 | Telnet | Remote login (unencrypted) |
| 25 | SMTP | Email sending |
| 53 | DNS | Domain Name System |
| 67, 68 | DHCP | Dynamic Host Configuration |
| 80 | HTTP | Web (unencrypted) |
| 110 | POP3 | Email retrieval |
| 143 | IMAP | Email (server-based) |
| 443 | HTTPS | Secure Web |
| 3389 | RDP | Remote Desktop |
ARP & DHCP
ARP (Address Resolution Protocol)
- Maps IP address to MAC address
- ARP Request: Broadcast "Who has IP?"
- ARP Reply: Unicast "MAC is..."
- Cached in ARP table
DHCP (Dynamic Host Config)
- DORA: Discover → Offer → Request → Acknowledge
- Assigns IP, subnet mask, gateway, DNS
- Lease time for temporary assignment
DNS
Domain Name System translates hostnames to IP addresses.
Record Types:
- A: IPv4 address
- AAAA: IPv6 address
- CNAME: Alias to another name
- MX: Mail server
- NS: Name server
- PTR: Reverse lookup
8. Key Takeaways for CpE Students
Essential Formulas & Concepts
Subnetting
- • Subnets = 2^(borrowed bits)
- • Hosts = 2^(host bits) - 2
- • Block size = 256 - mask value
OSI Layers
- • L1: Physical (bits)
- • L2: Data Link (frames, MAC)
- • L3: Network (packets, IP)
- • L4: Transport (segments, ports)
IP Classes (First Octet)
- • A: 1-126 (/8)
- • B: 128-191 (/16)
- • C: 192-223 (/24)
TCP Handshake
- • SYN → SYN-ACK → ACK
- • Connection-oriented
- • Reliable delivery
Must-Know Port Numbers
FTP: 20/21
SSH: 22
Telnet: 23
SMTP: 25
DNS: 53
HTTP: 80
HTTPS: 443
DHCP: 67/68
RDP: 3389