7 Networking Layers

Open System Interconnection (OSI) model is a conceptual framework that defines how to implement network protocols. It was developed by the International Standards Organization (ISO) in order to standardize communication functions. The goal is interoperability of different systems through a standard protocol. The concept is based on the work of Charles Bachman at Honeywell Information Services.

OSI breaks network communication into 3 upper and 4 lower layers. The lower layers are concerned with moving data around whereas the upper layers are concerned with how the data is used by an application. In the four lower layers you have a data transmission layer that is wrapped in an error prevention layer. The three upper layers are concerned with the control of a connection and then the presentation and interaction with the data. These layers do a specific job then pass the data to the next layer up or down depending on the direction of the flow.

“Data is like an ogre, or an onion, it’s wrapped in a lot of layers…and probably stinks.”

Each layer is a set of protocols for communicating to other devices at that level, also known as peers. They exchange what are called protocol data units (PDU). Each PDU contains data to be transmitted in the form of a service data unit (SDU) as well as a layer or protocol-specific header and/or footer.

The data is then processed following this pattern: The data to be transmitted is composed at the topmost layer of the transmitting device into a protocol data unit (PDU). The PDU is passed to the next lowest layer, where it is known as the service data unit (SDU). At the next lowest layer the SDU is concatenated with a header, a footer, or both, producing a PDU for that layer. It is then passed to down a layer. The process continues until reaching the lowermost level, from which the data is transmitted to the receiving device. At the receiving device the data is passed from the lowest to the highest layer as a series of SDUs while being successively stripped from each layer’s header or footer, until reaching the topmost layer, where the last of the data is consumed

This is a very brief overview of networking layers as there is a lot of information beyond what is it. Use this as a starting point to learn more about how the application you are writing is passing data around. While most of us developer will not get into the lower layers except on rare occasions it is good to know some basics of networking so that you can better diagnose and debug problems when they do arise.

Episode Breakdown

Lower Layers

14:55 Physical

The physical layer is concerned with transmitting and receiving an unstructured raw bit stream. This is done over a physical medium. It describes the electrical, mechanical, and functional interfaces of that medium. Example of layer 1 protocols are the standards around Ethernet cables and how they are laid out so that all Ethernet ports function similarly.

“The cables are color coded and you lay them out flat and cut the ends.”

This layer defines the relationship between a device and a physical transmission medium. This could be an electrical cable, radio frequency link, Ethernet cable, etc. It is concerned with the layout of the pins, voltage, line impedance, and other physical characteristics of transmitting. Bit rate and data encoding is controlled at the physical layer. It also determines the way the encoded bits will be transmitted either digital (baseband) or analog (broadband).

Network topology is the arrangement of various elements in a communication network. Physical topology is the placement of the various components of a network (e.g., device location and cable installation). Logical topology illustrates how data flows within a network. A common example would be a LAN (local area network) where any given node in the LAN has one or more physical links to other devices.

“I think of the Halo LAN parties that we had.”

The physical layer also sets out the transmission mode or directionality of the communication. Simplex is a unidirectional communication channel, sending information in one direction only. Half duplex is a bidirectional communication channel, however only one direction may be communicating at a time. Full duplex is also a bidirectional communication channel that allows simultaneous communication.

19:45 Data Link

The data link layer is concerned with error-free transfer of data frames from one node to another over the physical layer. This is a link between two directly connected nodes. It detects and corrects errors from the physical layer. It does this by establishing the logical link between nodes and terminating it. Higher layers can assume error-free transmission.

A data frame is a container for a single packet of data that is to be transmitted. Frame traffic control restricts the transmitting node when there is not a frame buffer available. Frame delimiting creates and recognizes frame boundaries. Frame sequencing puts the frames being transferred in order. Frame error checking makes sure that the frame’s integrity is intact. Frame acknowledgement is a way in which the data layer prevents errors by requiring retransmission of frames that were not acknowledged and handling duplicate frames on the receiving end.

“You want at least once transmission.”

The data link layer is divided into two sub layers. MAC (Medium access control) layer is responsible for access and permissions between devices. LLC (Logical link control) layer encapsulates the network layer protocols and controls error checking and frame synchronization.

23:50 Network

The network layer is concerned with switching, routing, and fragmentation of data. It decides which physical path the data will take. This determination is based on criteria such as network conditions, priority, etc. It keeps the upper layers from needing to know anything about the data transmission and intermediate switching technologies used to connect systems. It establishes, maintains and terminates connections.

“His laptop, his desktop, and my laptop would all be nodes on the network.”

A network is a place where many nodes can be connected. Each node on the network has an address. It provides a connection-less communication meaning that data packets can travel to a recipient without the need for an acknowledgement. This allows the network to find a way to deliver the data to it’s destination.

Routing determines how data will get from one node to another. Routers are network layer intermediate systems that move packets of data from sender to destination. This may mean going through intermediary nodes to get to the final destination. Peer protocols exist between a node and its immediate neighbor, but the neighbor may be a node through which data is routed not the destination. The source and destination may be separated by many intermediate nodes. This includes traffic control as routers can tell a sender to refrain from transmitting if the buffer fills up. Usage accounting functions keep track of packets forwarded by intermediate systems.

Frame fragmentation is the breaking up of a packet into smaller frames of data to be reassembled on the receiving end. This happens when the downstream router’s maximum transmission unit (MTU) is smaller than the packet size. Each frame fragment of the original packet is sent independently.

33:05 Transport

“Just like the data link layer was the error protection for the physical
this is the error protection layer for the network layer.”

The transport layer is concerned with delivering error-free data without loss or duplication. It removes concern about transfer between peers from the higher layers. How much is needed in the transport layer depends on the services available from the network layer. The larger and more complex the network layer the smaller the transport layer needs to be. Small or unreliable network layers need larger transport layers to prevent data loss or corruption.

The transport layer improves the reliability of a given network connection through flow control, segmentation/desegmentation, and error control. It controls the flow by telling the transmitting node to slow down or stop if the buffers are full. Data is split into smaller frames in order to be passed down to the network layer. The transport layer can accept relatively large messages. There are strict message size limits imposed by the network (or lower) layer. Session multiplexing puts several sets of data or messages into one logical link and tracks which messages belong to which sessions. It maintains reliability of data transfer by providing acknowledgement of the receipt of the data.

There are five classes of the connection mode for the transport layer ranging from class 0 to class 4. Class 0 contains no error recovery. It was designed for use on network layers that provide error-free connections. Class 4 is closest to Transmission Control Protocol (TCP). Packets may be lost, duplicated, or delivered out of order. TCP fixes these problem providing reliable, ordered, and error-checked delivery.

Upper Layers

38:20 Session

“Under the hood this is stateless, the session creates state.”

The session layer is concerned with establishing, maintaining, and ending connections between applications. It provides for full-duplex, half-duplex, and simplex operations. It also establishes ways of checking, ending, and restarting connections.

“I was thinking of my data access layer.”

Allows for the establishment, maintenance, and termination of a session. A session in this sense is a connection between two machines or applications. It also provides support for the session through processes to allow communication and security.

This layer is responsible for the graceful closure of sessions. This is a part of the TCP. Checkpointing and recovery typically are not used in Internet Protocol Suite (TCP/IP).

42:05 Presentation

The presentation layer is concerned with transforming and translating data. It takes data from the application and transforms it into a format that can be sent over the network. On the reverse it takes data send in and translates it back into a format the application can use. This acts as a buffer to avoid compatibility problems between the data in the application and what is send over the network.

“When you send a byte array to someone you want that byte array
to mean the same thing to them as it means to you.”

The presentation layer provides data conversion, compression, and encryption. It converts data into the best format for the application or to be pass through the network. Data compression reduces the number of bits that need to be transmitted. It also encrypts data for security purposes.

49:46 Application

The application layer is concerned with providing users and application process with an interface or way of interacting with the network services. Contains resource sharing and device redirection. It also provides remote access to files, printers, etc. It allows for network management, electronic messaging (email), and virtual terminals.

“This layer is kind of open ended at this point because we like to stack layers on top of it.”

The application layer identifies communication partners, determines resource availability, and synchronizes communication. It determines the identity and availability of communication partners for an application with data to transmit. The layer or protocols do not determine resource availability but the logic in the application at this layer does.

What is done at the application level is specific to the application or set of applications. The most important distinction in the application layer is the distinction between the application-entity and the application.

IoTease: Project

Arty IoT


This IoT project is for the artsy or fashion minded in the audience. You’ll create a necklace of dangling lights that can be controlled lights which you can change color or turn on and off. It uses a web enabled Arduino and requires some knitting and/or sewing skills. This tutorial is great breaking it down for beginners and showing lots of detailed images. The project looks like something that my nieces would enjoy doing though they’d likely need some adult help for a few parts of it.

Tricks of the Trade

There are many layers of complexity in everything related to computer science. A simple JavaScript AJAX call traverses a huge amount of code, most of which you will be unaware of. Don’t mistake the black box for an empty box.

Tagged with: , , , , , , , , , , , , ,