The OSI Model

The Open Systems Interconnection (OSI) model is a way to help us conceptualize how data gets transfered from one point to another. This post describes the recommended 7 layered model, where 1 is the lowest layer in this model.

# Layer PDU Functions Examples
7 Application Data resource sharing, remote file access, directory services HTTP, LADP, SSH, FTP, SMTP, DNS
6 Presentation Data data conversion, compression, encryption SSL, Kerberos, JPEG, GIF, MIME
5 Session Data manages session for multiple data segments, continuous exchange of data between nodes NetBIOS, NFS, PAP, SCP, SQL, ZIP
4 Transport Segment, Datagram reliable transmission of data segments, acknowledgements and multiplexing TCP, UDP
3 Network Packet addressing, routing IPv4, IPv6, ICMP
2 Data Link Frame point to point data transmission Mac addresses, PPP
1 Physical Bit transmits raw bit streams Ethernet, RJ-45, physical connection

Each layer is built on the one below it. So we will decompile it from the bottom up.

  1. Our physical layer, there can be no data transmission without some means of a physical connection. This layer includes wireless cards, and old network hubs.
  2. The Data Link layer supports connetions from one node (your PC) to the very next connected node (your router). A great example of theses step by step node connections is to run a traceroute to a URL. Each connection is a router hop that uses the Data Link layer for its connection.

    K55N:~/Projects $ traceroute
    traceroute to (, 30 hops max, 60 byte packets
    1  homeportal (  1.589 ms  3.571 ms  4.364 ms
    2 (  358.589 ms  360.831 ms  362.335 ms
    3 (  358.151 ms  358.471 ms  362.285 ms
    4 (  363.783 ms  363.237 ms (  364.004 ms
    5 (  364.762 ms  365.137 ms  365.140 ms

  3. Networking layer provides the end to end connection. It would be the connection from our PC to the web server to view this page. The above Data Link layer doesn't know how to get to this point, instead it says "but I know someone who does" and keeps transfering the next router.

    port from to

    This is an over simplified version of a routing table, if the router recieves traffic destined to, it checks the table, which states to send that traffic out on port 6. The reciever on that end continues the same process until it narrows down to the node.

  4. Now that we can get information from one node to another, the next set of layers are more concerned with that actual moving of our data. Transport layer provides reliable, and multiplexing ports.

    Protocol Applications to
    TCP HTTP, FTP, Telnet error checking, connection oriented, ordered, uses ACK, heavyweight
    UDP VOIP, live streaming video no error checking, connection-less, unordered, no ACK, lightweight

    TCP will hold a packet if it recieves it out of order. Once it recieves the missing packet, it will process the held packet. This is to ensure our data is interpeted in the correct way. UDP will drop a packet if it recieves it out of order.

    ACK is a three way handshake to ensure data has been properly recieved. UDP has no use for this as it is dependant on real time. We wouldnt want to watch a clip of something that happend 30 seconds ago during a stream of live video. The same would go for a phone call.

    Speacial note for multiplexing: when you send a HTTP request for a webpage, the request will be on port 80, which how the server knows to translate it as an HTTP request. But the returning port will be an arbitrary number with the requestee's IP address. This arbitrary number is how our local machine is able to multiplex and keep track of which application sends the request.

  5. The Session layer sets up, coordinates, and terminates conversations, exchanges, and dialogues between the applications at each end. It deals with session and connection coordination. SQL is in this layer as our application needs to set up and cordinate with our database server.
  6. The presentation layer works to transform data into the form that the application layer can accept. This layer formats and encrypts data to be sent across a network, providing freedom from compatibility problems
  7. Everything at this layer is application-specific. This layer provides application services for file transfers, e-mail, and other network software services. Telnet and FTP are applications that exist entirely in the application level.