🌐

TCP/IP Stack and Networking Basics

Jun 14, 2025

Overview

This lecture covers the four layers of the TCP/IP stack, explains the concept of sockets, and clarifies the role of MAC addresses in computer networking.

The TCP/IP Protocol Stack

  • TCP/IP is a suite of protocols including Transmission Control Protocol (TCP) and Internet Protocol (IP).
  • It consists of four layers that manage all incoming and outgoing data across a network.
  • Each data packet passes down and up through these layers during transmission.
  • The stack enables any device running TCP/IP to communicate and transfer data over the internet.

The Four TCP/IP Layers

  • Application Layer: Handles protocols related to specific software applications, like HTTP or FTP, and adds an application header to data.
  • Transport Layer: Uses TCP to establish end-to-end connections, splits data into packets, numbers them, and assigns port numbers for correct reassembly.
  • Network Layer (Internet Layer): Adds source and destination IP addresses to each packet; routers use this to direct packets.
  • Link Layer (Physical Layer): Adds source and destination MAC addresses and manages the physical network connection.

Sockets and Ports

  • A socket combines an IP address and a port number, uniquely identifying a connection and the application that should receive the packet.
  • Ports determine which application on a device handles the incoming data.

MAC Addresses vs. IP Addresses

  • IP addresses are logical, can change, and operate at the Network Layer (Layer 3).
  • MAC addresses are physical, hard-coded to each network interface card, never change, and operate at the Link Layer (Layer 2).
  • MAC addresses are 12-digit hexadecimal numbers unique to every network device.

Key Terms & Definitions

  • TCP/IP — A suite of networking protocols for communication across networks.
  • Application Layer — The top TCP/IP layer handling protocols for applications.
  • Transport Layer — Manages data segmentation, connection, and port numbers via TCP.
  • Network Layer — Assigns IP addresses and directs packets through routers.
  • Link Layer — Manages physical connections and uses MAC addresses.
  • Socket — Combination of IP address and port number for network communication.
  • MAC Address — A unique, hardware-based identifier for network devices.

Action Items / Next Steps

  • Review the individual functions of each TCP/IP layer.
  • Understand the differences between MAC and IP addresses.
  • Learn more about common application-layer protocols (e.g., HTTP, FTP).