OSI Model

  • Open System Interconnection Model
  • 7 layers reference model that defines and separates networking hardware and software into distinct layers and functions

PleaseDoNotThrowSausagePizzaAway
PhysicalData LinkNetworkTransportSessionPresentationApplication

Physical Layer

  • **Protocol Data Unit: **Bits
  • **Carry bit stream over physical medium **
  • Bit Transmission Rate is defined by physical layer
  • Synchronisation of bits: Sender and receiver use the same bit rate and be synchronised to prevent data loss or corruption

Representation of Bits

  • Bits encoded into electrical/optical signals
  • Digital signals use discrete voltages
  • Analog signals are continuous waveforms that represent data as continuously varying voltage, current or EM radiation

Line Configuration

  • Connection of devices to the media (point to point or multipoint)
  • Point to Point: Dedicated link between 2 devices; entire capacity of the link is reserved for transmission between the 2 devices
  • Multipoint: More than two devices share a single link

Physical Topology

  • Defines how devices are connected to make a network
**Mesh **Topology
- Each device/node has a dedicated point-to-point link to every other node
- Peer-to-Peer connectivity
**Star **Topology
- Each device/node has a dedicated point-to-point link to the central controller
- Client-Server connectivity
**Bus Topology
- Multipoint connection
- Long cable acts as backbone
- Devices are connected to bus cable by
drop lines **and taps
**Ring **Topology
- Each device has dedicated point-to-point link with 2 devices on either side
- Signal passed along ring in one direction from device to device until it reaches destination

Transmission

Transmission Media
  • Wired transmission
    • Twisted pair cable: Ethernet LANS
    • Coaxial cable: Cable TV, older networks
    • Fiber Optic cable: transmit data at high speed over long distance
  • Wireless transmission
    • Radio waves: WiFi and mobile networks
    • Microwaves: Satellite and long distance comms
    • Infrared waves: short range comms (TV remote)
Transmission Mode
Simplex
- Monodirectional Communication
- E.g. Keyboards, monitors
Half-Duplex
- Each device can both transmit and receive, but not at the same time
- E.g. Walkie-talkies
Full-Duplex
- Both devices can transmit and receive simultaneously
- E.g. Telephone
  • **Protocol Data Unit: **Frame
  • Allows direct communication between two devices on the same local network
  • Flow control: Prevents overwhelming receiver if rate of data absorbed is less than rate of data produced
  • **Error control: **Detecting and retransmitting damaged or lost frames
    • Parity Bits: Detect single-bit errors
    • Checksums: Hashing data to detect corruption or changes
    • Cyclic Redundancy Check (CRC): Detect errors from noise or interference
  • **Access control: **Data link protocols determine which device has control over the link
    • Media Access Control (MAC) to avoid collisions
    • Carrier Sense Multiple Access (CSMA) with Collision Detection / Avoidance
    • CSMA/CD: Ethernet: devices **detect **collisions and mitigate them
    • **CSMA/CA: **Wireless networks: **avoid **collisions by conducting handshake
  • Physical addressing
    • Adds a header to the frame to define the sender and/or receiver of the frame
    • If frame is intended for system outside the sender’s network, receiver address is of the connecting device that connects the network to the next one

Components of Frame

  • **Header **with MAC address of **source **and destination
  • **Payload **or Data
  • **Trailer **with error-checking info

Sublayers

  • LLC (Logical Link Control)
    • Interface with network layer, handles error checking and flow control
  • MAC (Media Access Control)
    • Handles channel access and physical addressing
  • MAC Address: 6 byte hardware address
    • **First 3 bytes: **OUI

Organisationally Unique Identifier - Identifies Manufacturer

  • **Last 3 bytes: **

Device-Specific identifier

Network Layer

  • Responsible for source-to-destination (machine-to-machine) delivery of a packet
  • Logical addressing
    • If a packet passes network boundary, network layer adds a header that includes the logical addresses of sender and receiver
  • Routing
    • When independent networks or linked are connected together, connecting devices (routers or switches) route or switch the packets to final destination

Transport layer

  • Protocol Data Unit: Segment / Datagram
  • Process-to-process (application-to-application) delivery of the message
  • Ensures whole message arrives intact and in order: error and flow control at the source-to-destination level
  • **Service-point addressing **
    • Computers often run several programs at the same time
    • Source-to-destination delivery must be from a specific process on one computer to specific process on another
    • Transport layer header contains Service-point address (or port address)
  • Segmentation and Reassembly
    • Message is divided into transmittable segments with a sequence number
    • These segments are reassembled at the transport layer of the recipient
  • Connection Control
    • Connectionless transport **layer **treats each segment as independent packets → Delivers segment to the transport layer at destination machine
    • Connection-oriented transport **layer **makes connection with transport layer at destination machine → Delivers datagram and terminating at end
  • Flow control is performed end to end
  • Error control is process to process

Session Layer

  • Provides ability for presentation entities to organise communication
  • This is done for multiple communication sessions taking place at the same time
  • Session initiation and teardown: Starting and ending sessions between communicating entities, allowing data transfer to happen between
  • Token management: Manages communication mode (simplex, half or full duplex)
  • Session-connection to Transport-connection (connection-oriented transfer): Map between transport layer connections and the sessions taking place

Presentation Layer

  • Responsible for the way data is presented to the application
  • Negotiates the form of data to be transferred (through Transfer Syntax)
  • Presentation layer can provide compression, encryption, translation

Application Layer

  • Defining services at user-end
  • Provides identification of services provided
  • Defining Quality of Service (QoS) parameters for the application
  • Defining security mechanisms (access control, authentication)
  • Synchronisation of communication applications (connection-oriented)

Encapsulation

Flow of data from application to physical layer

End-to-End Data Flow

At Host A
  1. Application Layer: Decides it needs to communicate with Host B
  2. Presentation Layer: Conducts required **transformations **(compression, encryption, translation)
  3. Session Layer:** Initiates communication session** → Data is segmented, **Header **(containing sequence and acknowledgment number) is added to each segment
  4. Transport Layer: **Puts data **into **segments **and decides on connection control
  5. Network Layer:** Puts data** into **packets **and **headers **are added to packets
  6. Data Link Layer: **Puts data **into **frames **and adds header and trailer to each frame
  7. Physical Layer: Dealt with as raw bits → transferred through physical channel to the **router **
At Router
  1. Router reads up to network layer **header **to route data (partial decapsulation)
At Host B
  1. Physical Layer: Raw bits are **elevated **as **frames **into data link layer
  2. Data Link Layer: **Header **and **trailer **are read by data link layer and removed
  3. Network Layer: Header of packet is **read **to determine if it is correct destination → **Header **is removed
  4. Transport Layer: **Header **of each segment read to determine sequence number to arrange segments → **Header **is removed
  5. Session Layer determines if this is the end of this session → Requests to end session if so → Else session layer waits for more data
  6. Presentation Layer: Decompression, **decryption **and translation
  7. Application Layer: Received by user