OSI Model

Fundamentals of Network Protocols

  • In networking, a protocol is defined as a set of rules for formatting and processing data.

  • Network protocols function as a common language for computers within a network.

  • These protocols enable communication between systems that may use vastly different software and hardware, ensuring interoperability regardless of underlying technical differences.

  • Examples of common protocols include:

    • HTTP (Hypertext Transfer Protocol)

    • HTTPS (Hypertext Transfer Protocol Secure)

    • SMTP (Simple Mail Transfer Protocol)

    • FTP (File Transfer Protocol)

    • TCP (Transmission Control Protocol)

    • UDP (User Datagram Protocol)

The Open System Interconnection (OSI) Model Overview

  • Internetworking models are utilized to organize and describe specific network functions.

  • The OSI Model is a conceptual framework consisting of seven abstraction layers.

  • It was created to achieve interoperability among diverse devices from different vendors.

  • The model partitions communication systems into distinct abstraction layers, where each layer describes a unique set of functions.

  • Protocols serve as the standard terms that computers use to understand each other across these layers.

  • Mnemonics for the OSI Layers (Top-to-Bottom: 7 to 1):

    • All People Seem To Need Data Processing

  • Mnemonics for the OSI Layers (Bottom-to-Top: 1 to 7):

    • Please Do Not Throw Sausage Pizza Away

Layer 7: The Application Layer

  • This layer serves as the entry door to network services at a lower level.

  • User applications sit on top of this layer and use it to get services when they transmit (TXTX) or receive (RXRX) data over a network.

  • Functions include generating data for transmission, processing received data, and interfacing user applications with network management services and remote access.

  • It is specifically identified as the playground of hackers in modern networking.

  • Specific Protocols and Port Numbers at Layer 7:

    • Simple Mail Transfer Protocol (SMTP): Port 2525

    • Simple Network Management Protocol (SNMP): Port 161161

    • Hypertext Transfer Protocol (HTTP): Port 8080

    • Line Printer Daemon (LPD)

    • File Transfer Protocol (FTP): Port 2121

    • Telnet: Port 2323

    • Trivial File Transfer Protocol (TFTP): Port 6969

    • Electronic Data Interchange (EDI)

    • Post Office Protocol version 3 (POP3): Port 110110

    • Internet Message Access Protocol (IMAP): Port 143143

    • Network News Transport Protocol (NNTP)

    • Secure Remote Procedure Call (S-RPC)

    • Secure Electronic Transaction (SET)

    • Domain Name System (DNS)

    • Peer-to-Peer (P2P)

Layer 6: The Presentation Layer

  • The Presentation Layer is concerned with the format that applications must use for common understanding.

  • It gets data ready for the application layer by performing the following core services:

    • Data Conversion

    • Character Code Translation

    • Compression

    • Encryption and Decryption

    • Encoding

  • Standards and Data Formats at Layer 6:

    • American Standard Code For Information Interchange (ASCII)

    • Extended Binary-Coded Decimal Interchange Mode (EBCDIC)

    • Tagged Image File Format (TIFF)

    • Joint Photographic Experts Group (JPEG)

    • Motion Picture Experts Group (MPEG)

    • Musical Instrument Digital Interface (MIDI)

    • Hypertext Markup Language (HTML)

    • Word Documents (DOC)

    • MP3

    • AVI

    • Sockets

Layer 5: The Session Layer

  • The Session Layer provides a logical persistent connection between peer hosts.

  • It manages the "conversation" between applications exchanging information.

  • Responsibilities include the creation, monitoring, and tearing down of sessions.

  • It provides dialog control, allowing multiple persistent connections from different sources to be combined or synchronized.

  • Communication Modes:

    • Full Duplex

    • Half Duplex

    • Simplex

  • Specific Protocols and Services at Layer 5:

    • Network File System (NFS)

    • Structured Query Language (SQL)

    • NetBIOS

    • Remote Procedure Call (RPC)

    • Session establishment in TCP

    • Session Initiation Protocol (SIP)

    • Real-time Transport Protocol (RTP)

    • RPC-Named pipes

Layer 4: The Transport Layer

  • This layer handles end-to-end communication and transport between peer hosts.

  • Transmission Control Protocol (TCP):

    • Full-duplex, connection-oriented communication.

    • Reliable delivery using flags for session management.

  • User Datagram Protocol (UDP):

    • Simplex, connectionless communication.

    • Best-effort delivery without guarantees.

  • Additional Protocols:

    • Secure Sockets Layer (SSL)

    • Transport Layer Security (TLS)

    • Stream Control Transmission Protocol (SCTP)

    • Sequenced Packet Exchange (SPX)

  • Port Classifications:

    • Well-Known Ports: Ports 010230 - 1023

    • Registered Ports: Ports 1024491511024 - 49151

    • Dynamic or Private Ports: Ports 491526553549152 - 65535

Layer 3: The Network Layer

  • The primary role is to move data between two hosts that are not physically connected.

  • It uses logical addresses, specifically IP addresses, for path determination.

  • The Network Layer uses routing tables to find the best delivery route but does not guarantee delivery.

  • Devices operating at this layer: Routers.

  • Specific Protocols at Layer 3:

    • Internet Protocol (IP): Connectionless protocol for addressing.

    • Internet Control Message Protocol (ICMP)

    • Routing Information Protocol (RIP)

    • Open Shortest Path First (OSPF)

    • Border Gateway Protocol (BGP)

    • Internet Group Management Protocol (IGMP): Supports multicasting.

    • Internetwork Packet Exchange (IPX)

    • Internet Protocol Security (IPSec)

    • Network Address Translation (NAT)

    • Simple Key Management for Internet Protocols (SKIP)

    • Address Resolution Protocol (ARP): Operates at this level for path determination (also associated with Layer 2).

Layer 2: The Data Link Layer

  • This layer provides communication within the same network using physical (MAC/Hardware) addresses.

  • It receives packets from the Network Layer and encapsulates them into frames for transmission to the next physically connected device.

  • Responsibilities include frame creation, error detection within frames, and converting information into bits.

  • Devices operating at this layer: Switches and bridges.

  • Data Link Sublayers:

    • Media Access Control (MAC): Manages protocol access to the physical network medium. It handles addressing and channel access control mechanisms.

    • Logical Link Control (LLC): The upper sublayer that provides flow control and error control.

  • Protocols and Standards at Layer 2:

    • Address Resolution Protocol (ARP): Resolves IP into MAC.

    • Reverse Address Resolution Protocol (RARP): Resolves MAC into IP addresses.

    • Point-to-Point Protocol (PPP)

    • Serial Line Internet Protocol (SLIP)

    • Layer 2 Forwarding (L2F)

    • Layer 2 Tunneling Protocol (L2TP)

    • Point to Point Tunneling Protocol (PPTP)

    • Ethernet (IEEE802.3IEEE \, 802.3): The only remaining standard in common use.

    • Token Ring (IEEE802.5IEEE \, 802.5)

    • Wireless Local Area Network (IEEE802.11IEEE \, 802.11)

    • Fiber Distributed Data Interface (FDDI)

    • Asynchronous Transfer Mode (ATM)

    • Copper Distributed Data Interface (CDDI)

    • Virtual LAN (VLAN)

    • HDP

    • Fibre Channel

    • Frame Relay

    • High-Level Data Link Control (HDLC)

    • Q.921

Layer 1: The Physical Layer

  • The Physical Layer is responsible for media, signals, and binary transmission.

  • It receives bits from the Data Link Layer and converts them into physical signals:

    • Electrical signals for copper cables.

    • Photons or beams of light for fiber optic cables.

    • Radiofrequency for wireless communications.

  • Devices at Layer 1: Cables, connectors, wireless access points (WAPs), hubs, modems.

  • Standards and Interfaces at Layer 1:

    • EIA/TIA-232 and EIA/TIA-449

    • RS-232, RJ45, V.34

    • X.21

    • High-Speed Serial Interface (HSSI)

    • Synchronous Optical Networking (SONET)

    • SDH

    • V.24 and V.35

    • Integrated Services Digital Network (ISDN)

    • Digital Subscriber Line (DSL)

    • 10BASE-T, 10BASE2, 10BASE5

    • 100BASE-TX, 100BASE-FX, 100BASE-T

    • 1000BASE-T, 1000BASE-SX

Encapsulation and Protocol Data Units (PDUs)

  • Encapsulation is the process of data moving down the OSI model stack from the Application layer to the Physical layer.

  • De-encapsulation is the process of data moving up the stack from the Physical layer back to the Application layer.

  • Protocol Data Units (PDUs) by Layer:

    • Layers 7, 6, 5: Data Stream

    • Layer 4: Segment (TCP) or Datagram (UDP)

    • Layer 3: Packet

    • Layer 2: Frame

    • Layer 1: Bits

  • Mnemonic for Data Units: Don’t Stop Pouring Free Beer (Data, Segment, Packet, Frame, Bits).