Tuesday, May 22, 2007

Day 31 - The OSI Model

I had a difficult time deciding if I was going to talk about Microsoft, Cisco, or the Bible so I just decided "why not networking?" Therefore, the most logical place to start in networking is the OSI reference model. By the way, I am going to be using this blog to help me recertify my CCNA and will be following the organization of Scott Bennett's 31 Days Before Your CCNA Exam but I will be referring to primarily internet articles for more information.

What does OSI mean?
OSI stands for Open Systems Interconnection.

A brief history
Before the 70s when computer were really becoming desirable by researchers everybody had to write their own protocols and software for the specific mainframe that they was on their campus. There was no way no collaborate with other students and professors and most cases they didn't want to because they feared that would mean reinvesting in new hardware and reprogramming code.

Therefore, the International Organization for Standardization (ISO) took up the charge to create an universal set of protocols called the OSI protocol suite. Alongside their protocol suite ISO created a model which showed how everything should fit into place. It was nice, neat and had clear boundaries. In the early 80's it competed with the TCP/IP protocol for usage by vendors. TCP/IP won by the way. However, the model has stuck around to be relegated to a mere tool for education and for developers to use as a "guideline" forever to be separated nearly from being the law of the land. As a result of it losing the battle most technologies do not perfectly fit within the seven layers.

Why is it something I should know?
The OSI reference model is important to understand because it explains and "simplifies" how devices on a network communicate. The model splits this great big black box known as a "computer network" into seven pieces henceforth called layers which play a particular role in getting information from point A to point B. One example of how the OSI model is practical is that the OSI model organizes my brain whenever I need to solve a connectivity problem between machines. Both article number one and number two by Techrepublic's David Davis explain how this model can be used in a few different ways to solve network problems. Another application is that it can help developers clarify the roles performed by each component in a networking system.

So what are these layers?
Here's a picture of the seven layers and the names of the PDUs (Protocol Data Units) at any given point during transmission; the boxes in the middle. It's important to note that each PDU has a specific format.

For now lets continue with a high level overview. Each layer is responsible for performing its specific task and dealing with the layers above and below. The lower layers (1-4) deal more moving the data around and transition from hardware and software as you proceed up the model. The upper layers (5-7) are concerned primarily with user interaction and implementing applications over the network than how the data is delivered. As a result, the lower layers are handled by every device in between source and destination and the upper layers are handled by software. Each layer only interacts with its adjoining layer via service data units (SDU) and logically with its peer layer on the destination computer.

What's done at each layer?

Physical
- Bits physically pulse or wave their way over the network media representing 1s or 0s. This layer is responsible for:

  • operation of hardware devices
  • various encoding and signaling functions that transform data to signals
  • transmission and reception of those signals
  • voltage of electrical current to transport signal
  • media type and impedance characteristics
  • physical shape of connector to terminate media
  • physical topology

Something the physical layer does not describe is the transmission media itself, so feel free to shoot data across whatever media you like as long as everything leading up to that point is within specification.

Wireless technology has also added to the list of what operates at this layer: frequency, amplifiers, antenna mode, and radio role.

As with layer 2 and 3 networking devices operate at different layers of the model. When networks talk about devices at a layer they typically are saying what the highest layer is that such and such device operates at and are implying that said device also operates at lower layers. Therefore both a hub and a repeater operate no higher than the physical layer. I'll talk more about what that means in terms of network traffic in a later post, but if you take what I have all ready described about the physical layer you'll already have a good picture.

Data Link - Many wired and wireless LAN (Local Area Network) technologies function at this layer. For example, switches, bridges, and even the network interface card (NIC) that’s probably connecting you to the Internet right now. At this layer information stops getting less physical and more logical. Therefore, another standards body called the Institute of Electrical and Electronics Engineers (IEEE) for their 802 Project divide the data link layer into sublayers known as media access control (MAC) and logical link control (LLC).

The MAC sublayer is the physical half is used by devices to control access to the network medium which includes physically transmitting and receiving data as well as having a physical address assigned by both the IEEE and the card's manufacture. Rules are made and implemented at this sublayer for managing the shared medium to avoid conflicts. I will return to the MAC layer another time.

The LLC sublayer is the logical half of the data link layer and provides services to the network layer (above it) and hide the rest of the details of the data link layer. It also identifies the upper-layer protocol, control functions, and connection services. This sublayer can also provide reliable delivery of data frames.

Network - Provides (logical) connectivity and path selection between two host systems that might be located on different networks. Additionally, this layer is where logical addressing happens. Routers embody this layer as they are the devices that manage almost everything at this layer and divide networks. The functions at this layer are:

  • Logical Addressing - An address that devices communicate with that is independent of hardware and unique across the entire network; the implementation is called a routed protocol
  • Routing - Moving data across a series of networks. Routing protocols do this by communicating with other routers to update and maintain tables thereby supporting routed protocols
  • Packet Encapsulation - Takes data from higher layers and places them into packets
  • Error Handling and Diagnostics - Special protocols allow logically connected devices to exchange information about the status of hosts on the network or themselves

The use of the network layer is optional in data communications. It is only required if either the corresponding host resides on another network, or if an application requires its services.

Transport - This is a transition point between the lower layers that deal with data delivery issues, and the higher three layers that work with application software. Unlike the data link layer, the transport layer can provide this function beyond the local LAN segment because it’s on top of the network layer. Or to put it another way, the transport layer only performs its operations at endpoints, while the data link layer performs its operation at every stop along the path. The transport layer does the following:

  • Segments (or divides into smaller pieces) upper-layer application data
  • Sends those segments from one end device to another end device
  • Process-Level Addressing - This allows the computer to differentiate between software programs and different instances of the same program
  • Multi-/Demultiplexing - Using the above addressing, transport layer protocols combine (multiplex) the data from many processes into a single stream of data to be sent and demultiplex is the opposite when it arrives at its destination

The layer may also:

  • Establish end-to-end operations
  • Flow control provided by sliding windows
  • Reliability provided by sequence numbers, acknowledgments and retransmissions


Session - Set up, manage, and tear down sessions between programs exchanging data. Instead of protocols per se, software at this level resembles tools called application program interfaces (APIs) which allow programmers to develop networking applications without needing to know lower-level details.

Presentation - Responsible for managing the way data is encoded. It differs from the other layers in two key respects. First, it’s more limited and specific it function than the others. Second, it is not used as often and is not required by many protocols for communication. Here are some of specific types of data-handling issues the presentation layer handles:

  • Translation - On any given network different types of computers can exist such as PCs, Macs, Linux systems. Each has its own characteristics and represents data in different ways. The presentation layer hides these differences between machines.
  • Compression - Compression and decompression may be done here to improve throughput of data
  • Encryption - Some types of en/de-cryption are performed at this layer to ensure the security of the data as it travels down the protocol stack. For example, the SSL protocol.

Graphic standards such as PICT, TIFF and JPEG operate here as well as sound and movie formats MIDI and MPEG just to name a few.

Application - When I first was learning about the Application layer I made the mistake of thinking this layer was taking about Internet Explorer and Netscape Navigator but these are user applications. What the model's creators had in mind is network applications which serve user applications outside of the OSI Model.

For example, the two browsers (think Firefox instead of Navigator) both use the same network protocol that operates at the application layer called Hypertext Transfer Protocol (HTTP). With a few exceptions, all of your different web applications, e-mail clients or whatever else you use the internet for use some network application at the application layer.

I'm finally done writing this :) Trust me, if it's any good it won't take you as long to read it as it took me to write it. Please tell me if it lagged anywhere or I was unclear anyplace. If it seemed too academic then I achieved my goal because next I'll write about how the Internet really works, the TCP/IP protocol; hopefully it will be a bit shorter too. I didn't write all this out of my head, so here are all my other references:

  1. Data Communication & Computer Networks: A Business User's Approach, 2nd Ed. Curt M. White. Thomson Course Technology, 2002.
  2. Cisco Networking Academy Program CCNA 1 and 2 Companion Guide, Revised 3rd Ed. Cisco Press, 2004.
  3. Cisco Networking Academy Program Fundamentals of Wireless LANs Companion Guide. Cisco Press, 2004.
  4. IP Routing Fundamentals. Mark A. Sportack. Cisco Press 1999.
  5. The TCP/IP Guide: A Comprehensive, Illustrated Internet Protocols Reference. Charles M. Kozierok. No Starch Press, 2005. The online version is at: http://www.tcpipguide.com

No comments: