Skip to content
Back to Computer Engineering
Study Notes50 min read

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

7. ApplicationDataHTTP, FTP, SMTP, DNS, DHCP, SSHGateway
6. PresentationDataSSL/TLS, JPEG, MPEG, ASCII, MIME-
5. SessionDataNetBIOS, RPC, PPTP-
4. TransportSegmentTCP, UDP, SCTP-
3. NetworkPacketIP, ICMP, ARP, OSPF, BGPRouter
2. Data LinkFrameEthernet, PPP, MACSwitch, Bridge
1. PhysicalBitRS-232, RJ45, 100BASE-TXHub, Repeater
LayerPDUProtocolsDevices

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

4. ApplicationHTTP, FTP, SMTP, DNS, SSHOSI 5-7
3. TransportTCP, UDPOSI 4
2. InternetIP, ICMP, ARP, RARPOSI 3
1. Network AccessEthernet, Wi-Fi, PPPOSI 1-2

TCP vs UDP

FeatureTCPUDP
ConnectionConnection-orientedConnectionless
ReliabilityGuaranteed deliveryBest effort
OrderingOrdered deliveryNo ordering
Flow ControlYes (sliding window)No
Error CheckingYes, with retransmissionOptional checksum
SpeedSlower (overhead)Faster
Use CasesHTTP, FTP, EmailDNS, Streaming, Gaming

TCP 3-Way Handshake

Client
1. SYN (seq=x)
2. SYN-ACK (seq=y, ack=x+1)
3. ACK (ack=y+1)
Server

Connection established after 3-way handshake

4. IP Addressing

IPv4 Classes

ClassFirst OctetDefault MaskNetworksHosts/Network
A1-126255.0.0.0 (/8)12816,777,214
B128-191255.255.0.0 (/16)16,38465,534
C192-223255.255.255.0 (/24)2,097,152254
D224-239N/AMulticast
E240-255N/AReserved/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

PortProtocolDescription
20, 21FTPFile Transfer (Data, Control)
22SSHSecure Shell
23TelnetRemote login (unencrypted)
25SMTPEmail sending
53DNSDomain Name System
67, 68DHCPDynamic Host Configuration
80HTTPWeb (unencrypted)
110POP3Email retrieval
143IMAPEmail (server-based)
443HTTPSSecure Web
3389RDPRemote 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