Internet Protocols

Two Protocols

Open Systems Interconnection (OSI)

  • Overview
    • Based on strictly controlled layers
    • ISO standard
    • If you follow it it works, but not much room for expansion
    • Layers
      1. Physical
        • Provides electrical connections to a transmission medium
        • Uses bits
        • One device to another
      2. Data link
        • Packet framing. Hardware addressing
        • Uses MAC addresses and frames
        • One device to another
      3. Network
        • Addresses packets and routes them to provide end-to-end communication
        • One network to another
      4. Transport
        • Transfers data reliably or unreliably
        • Reliable transfer involves a connection
        • One process to another (TCP/UDP)
      5. Session
        • Opens/Closes session between applications
        • One application to another (socket port) (and the rest below)
      6. Presentation
        • Formats data (compression and encryption)
      7. Application
        • Provides the user interface

Internet Protocol (IP)

  • Overview
    • Incremental implementation and model
    • Based on loosely layered model
    • Created for ARPAnet (US military)
    • Not a strict standard, and fully extensible to allow for rapid innovation
  • Layer
    1. Access (ethernet and electrical connections)
    2. Network (IPv4 and IPv6)
    3. Transport (TCP, UDP)
    4. Application Protocols (FTP, TFTP, HTTP, SMTP, …)
  • Within OS
    1. Access: Network interface and driver
    2. Network/Transport: Protocol stack
    3. Application: Sockets API
  • Packet and Frames
    • Packet switching network protocol
    • The size of data sent over the network is more than just the data due to the overhead of each layer
    • Packets are for transmission between networks (contains IP)
    • Frames are for transmission through the access (contains MAC address)
    • Steps
      1. Data
      2. Addressing
      3. Routing
      4. Error Detection
  • Delivery Mechanisms
    • Unicast: Single destination
    • Multicast: Group destination
    • Broadcast: All network hosts

Transport Protocols

Transmission Control Protocol (TCP)

  • Connection-oriented protocol (impression of a dedicated channel)
  • Data is delivered in-order
  • Lost data (dropped packets) is re-transmitted
    • All data is sent with a transmission number and a checksum
    • Acknowledge sent for each package
    • Will resend if not acknowledged fast enough
  • Only unicast
  • Three step handshake
    1. A to B: sync
    2. B to A: acknowledge sync
    3. A to B: acknowledge
  • Three step handshake used for closing as well (just with finish instead of sync)
  • Features
    • The client sends a confirmation of data delivery to the server and data arrives
    • If a confirmation does not arrive after a timeout period, the server attempts retransmission for the data that was not delivered
    • In a congested network, TCP can delay data transmission
  • Flow control
    • Prevents a sender form overwhelming a receiver
    • invert
    • Receive window is the remaining space in the receive buffer. It can be used for simple load balancing
    • When the window size is 0, it will stop transmitting data
    • With every ack message, the receiver advertises its current receive window

User Datagram Protocol (UDP)

  • Connectionless (like a mailbox)
  • Best effort delivery
  • Data may arrive out of order
  • No handshake
  • Unicast, multicast, or broadcast
  • Features
    • Adapts to bandwidth-intensive applications that tolerate a loss of packets (ex: video streaming)
    • There are fewer delays in data transmission
    • It is used to send a large number of packets at a time
    • There is a possibility that you may lose some data