The OSI Model | Network+ N10-007 | 1.2

In this video you will learn about the OSI model & the TCP/IP stack.

OSI Model

The Open Systems Interconnection model is a conceptual model that characterizes & standardizes the communication functions of a telecommunication or computing system without regard to its underlying internal structure and technology.  Its goal is the interoperability of diverse communication systems with standard communication protocols.  The model partitions the flow of data in a communication system into seven abstraction layers, from the physical implementation of transmitting bits across a communication medium to the highest-level representation of data of a distributed application.  Each intermediate layer serves a class of functionality to the layer above it and is served by the layer below it.  Classes of functionality are realized in software by standardized communication protocols.

OSI model

Layer 1:  Physical Layer

The physical layer is responsible for the transmission and reception of unstructured raw data between a device and a physical transmission medium.  It converts the digital bits into electrical, radio, or optical signals.  Layer specifications define characteristics such as voltage levels, the timing of voltage changes, physical data rates, maximum transmission distances, modulation scheme, channel access method and physical connectors.  This includes the layout of pins, voltage, line impedance, cable specification, signal timing and frequency for wireless devices.  Bit rate control is done at the physical layer and may define transmission mode as simplex, half duplex, and full duplex.  The components of a physical layer can be described in terms of a network topology.  Physical layer specifications are included in the specifications for the ubiquitous Bluetooth, Ethernet, and USB standards.

Layer 2:  Data Link Layer

The data link layer provides node-to-node data transfer — a link between two directly connected nodes.  It detects and possibly corrects errors that may occur in the physical layer.  It defines the protocol to establish and terminate a connection between two physically connected devices.  It also defines the protocol for flow control between them.  IEEE 802 divides the data link layer into two sublayers:

  • Medium Access Control (MAC) layer:  responsible for controlling how devices in a network gain access to a medium & permission to transmit data.
  • Logical Link Control (LLC) layer:  responsible for identifying & encapsulating network layer protocols, and controls error checking & frame synchronization.

Layer 3:  Network Layer

The network layer is primarily concerned with forwarding data based on logical addresses.  The network layer provides the functional and procedural means of transferring packets from one node to another connected in “different networks”.  A network is a medium to which many nodes can be connected, on which every node has an address and which permits nodes connected to it to transfer messages to other nodes connected to it by merely providing the content of a message and the address of the destination node and letting the network find the way to deliver the message to the destination node, possibly routing it through intermediate nodes.  If the message is too large to be transmitted from one node to another on the data link layer between those nodes, the network may implement message delivery by splitting the message into several fragments at one  node, sending the fragments independently, and reassembling the fragments at another node.  It may, but does not need to, report delivery errors.  Message delivery at the network layer is not necessarily guaranteed to be reliable; a network layer protocol may provide reliable message delivery, but it need not do so.  

The network is responsible for a variety of tasks such as:

  • Logical addressing:
  • Switching:  packet switching & circuit switching
  • Message switching
  • Route discovery & selection
  • Connection services
  • Flow control (also known as congestion control)
  • Packet reordering

Layer 4:  Transport Layer

The transport layer acts as the dividing line between the upper layers and lower layers of the OSI model.  The transport layer provides the functional and procedural means of transferring variable-length data sequences from a source to a destination host, while maintaining the quality of service functions.  The transport layer controls the reliability of a given link through flow control, segmentation/desegmentation, and error control.  Some protocols are state- and connection-oriented.  This means that the transport layer can keep track of the segments and retransmit those that fail delivery.  The transport layer also provides the acknowledgement of the successful data transmission and sends the next data if no errors occurred.  The transport layer creates segments out of the message received from the application layer.  Segmentation is the process of dividing a long message into smaller messages.  

Two common transport layer protocols are:

  • Transmission Control Protocol (TCP):  a connection-oriented transport protocol
  • User Datagram Protocol (UDP):  a connectionless transport protocol

Two common flow control protocols are:

  • Windowing:  TCP communication uses windowing, in that one or more segments are sent at one time, and a receiver can attest to the receipt of all the segments in a window with a single acknowledgement.
  • Buffering:  A device (such as a router) uses a chunk of memory (buffer or queue) to store segments if bandwidth is not available to send the segments.  A queue has a finite capacity, however, and can overflow (drop segments) in case of sustained network congestion.

Layer 5:  Session Layer

The session layer controls the dialogues (connections) between computers.  It establishes, manages and terminates the connections between the local and remote application.  It provides for full-duplex, half-duplex, or simplex operation, and establishes procedures for checkpointing, suspending, restarting, and terminating a session.  In the OSI model, this layer is responsible for gracefully closing a session.  This layer is also responsible for session checkpointing and recovery, which is not usually used in the Internet Protocol suite.  The session layer is commonly implemented explicitly in application environments that use remote procedure calls.  In the modern TCP/IP system, the session layer is non-existent and simply part of the TCP protocol.

Functions of the session layer include:

  • Setting up a session
    • Checking user credentials (username & password)
    • Assigning numbers to a session’s communication flow to uniquely find each one
    • Negotiating services needed during the session
    • Negotiating which device begins sending data
  • Maintaining a session
    • Transferring data
    • Reestablishing a disconnected session
    • Acknowledging receipt of data
  • Tearing down a session
    • Session can be disconnected based on agreement of the devices in the session
    • Could be torn down because one party disconnects (intentionally or unintentionally)

Layer 6:  Presentation Layer

The presentation layer handles formatting the data being exchanged and securing that data with encryption.  The presentation layer establishes context between application-layer entities, in which the application-layer entities may use different syntax and semantics if the presentation service provides a mapping between them.  If a mapping is available, presentation protocol data units are encapsulated into session protocol data units and passed down the protocol stack.  This layer provides independence from data representation by translating between application and network formats.  The presentation layer transforms data into the form that the application accepts.  This layer formats data to be sent across a network which is sometimes called the syntax layer and can include compression functions.

Function of the presentation layer include:

  • Data formatting:  Some applications might format text using ASCII while other applications might format text using EBCDIC (Extended Binary Coded Decimal Interchange Code).  The presentation layer handles formatting the text in a format that allows compatibility between the communicating devices.
  • Encryption:  To add a layer of security for data transmissions, encryption is used to scramble data that would make it impossible for a 3rd party to decrypt the transmission.

Layer 7:  Application Layer

The application layer is the OSI layer closest to the end user, which means both the OSI application layer and the user interact directly with the software application.  This layer interacts with software applications that implement a communicating component.  Such application programs fall outside the scope of the OSI model.  Application-layer functions typically include identifying communication partners, determining resource availability, and synchronizing communication.  When identifying communication partners, the application layer determines the identity and availability of communication partners for an application with data to transmit.  The most important distinction in the application layer is the distinction between the application-entity and the application.  For example, a reservation website might have two application-entities:  one using HTTP to communicate with its users, and one for a remote database protocol to record reservations.  Neither of these protocols have anything to do with reservations.  That logic is in the application itself.  The application layer has no means to determine the availability of resources in the network.

Function of the application layer:

  • Application Services:  Examples of these services may include file sharing & email
  • Service Advertisement:  Some application services periodically send out advertisements (such as network printers), making their availability known to other devices on the network.

Easy Way to Remember the OSI Model Layers

Beginning from Layer 1 and going up through Layer 7: Please Do Not Throw Sausage Pizza Away

The TCP/IP Stack

The TCP/IP stack is a more relevant model for network designers & administrators to reference which was developed by the United States Department of Defense (DoD).  The TCP/IP stack has only four defined layers as opposed to 7 layers presented in the OSI model.  The TCP/IP stack allows for network designers & administrators to more easily categorize a given networking technology into a specific layer.

  • Network Interface:  Maps to Layers 1 & 2 (physical & data link) of the OSI model.
  • Internet:  Maps to Layer 3 (network) of the OSI model and focuses on IP as the protocol to be routed through a network.
  • Transport:  Maps to Layer 4 (transport) of the OSI model.  The two primary protocols found here are TCP & UDP.
  • Application:  Maps to Layers 5 – 7 (session, presentation, & application) of the OSI model.  
TCP/IP Stack