- Published on
KembaraXtra-Computer Science - The Internet Protocol Suite
Overview
The internet protocol suite standardizes communication on the internet.
Key protocols: Transmission Control Protocol (TCP) and Internet Protocol (IP), collectively known as TCP/IP.
Network protocols operate in a layered model called a network stack.
Layered Model (TCP/IP Model)
Four-layer model (TCP/IP model):
- Link
- Internet
- Transport
- Application
Protocols at each layer interact with adjacent layers only (encapsulation).
Each layer has specific responsibilities handled by protocols within that layer.
OSI Model
Another network model with seven layers.
Less relevant as the internet is based on the TCP/IP model.
Table of Layers and Protocols
| Layer | Description | Example Protocols |
|---|---|---|
| Application | Provides application-specific functionality (e.g., email, web pages). Structures data for process-to-process communication. | HTTP, SSH |
| Transport | Provides a communication channel for applications to send and receive data between hosts. | TCP, UDP |
| Internet | Enables communication across networks. Responsible for host addressing and routing data across the internet. | IP |
| Link | Enables communication on a local network. Closely associated with networking hardware (e.g., Wi-Fi). | Ethernet, Wi-Fi |
Data Transmission Flow
Outgoing Transmission: Travels down the network layers (Application → Transport → Internet → Link).
Incoming Transmission: Travels up the network layers (Link → Internet → Transport → Application).
Network hosts (clients, servers) use all four layers.
Networking hardware (switches, routers) often use only lower layers.
Detailed Layer Breakdown
1. Link Layer
Connects devices on the same local network.
Uses Media Access Control (MAC) addresses to uniquely identify devices.
Data is divided into frames (header, payload, footer).
Frame Header: Contains source and destination MAC addresses, data type descriptor.
Payload: Contains the data being transmitted.
Frame Footer: Used for error detection.
Examples:
- Wi-Fi (IEEE 802.11): Wireless communication.
- Ethernet (IEEE 802.3): Wired communication using RJ45 connectors.
Networking devices:
- Hub: Retransmits frames to all ports.
- Switch: Examines MAC addresses and sends frames to the correct port.
2. Internet Layer
Allows data to travel beyond the local network (routing).
Uses Internet Protocol (IP) for addressing and routing.
Every host has an IP address.
Data is sent in packets (enclosed in a link layer frame).
IP Packet Header: Contains source and destination IP addresses, IP version, header length.
Data Section: Payload.
IP Versions:
- IPv4: 32-bit addresses (dominant). Displayed in dotted decimal notation (e.g., 192.168.1.23).
- IPv6: 128-bit addresses.
Subnets:
- Devices on the same local network have IP addresses with the same leading bits.
- Devices on different subnets communicate through a router.
- IP address divided into: network prefix (shared by subnet) and host identifier (unique to host).
- CIDR Notation: IP address/prefix length (e.g., 192.168.1.23/24).
- Subnet Mask: 32-bit number indicating the network prefix (e.g., 255.255.255.0 for a 24-bit prefix).
- Network ID: Result of a bitwise AND between an IP address and subnet mask. Identifies the subnet.
- To determine if two computers are on the same subnet: perform a bitwise AND on both IPs with the subnet mask. If the result is the same, they are on the same subnet.
- Range of usable addresses: First and last address are reserved; others can be used by hosts.
3. Transport Layer
Provides a communication channel for applications.
Protocols:
- TCP (Transmission Control Protocol): Reliable, connection-oriented. Data is sent in segments.
- UDP (User Datagram Protocol): Unreliable, "best effort." Data is sent in datagrams.
TCP segment fits within an IP packet's data section.
Network Port Numbers: Identify specific services/processes on a host.
- Well-known ports: 0–1023
- Registered ports: 1024–49151
- Dynamic ports: 49152+
Servers listen on well-known ports. Clients use ephemeral ports.
Socket: An IP address plus a port number. Represents a network endpoint.
4. Application Layer
Focuses on specific application tasks.
Examples:
- HTTP (web content)
- SMTP (email)
- FTP (file transfer)
Application data is contained in the transport layer segment's data section.
Frame Structure
A frame contains:
- Link layer header and footer
- IP packet (header and data)
- TCP segment (header and data)
- Application data
Transmission Process Summary
Sending: Application data → Segment → Packet → Frame
Receiving: Frame → Packet → Segment → Application data