Layered Service Models
Like the airline system, the Internet is built on a layered architecture. This model is used not only to explain communication protocols but to develop them as well. It separates the functions performed by communication protocols into manageable layers stacked on top of each other. Each layer in the stack performs a specific function in the process of communicating over a network.
Generally, TCP/IP is described using four to five functional layers, commonly known as the protocol stack. The most common description is terms of the DoD reference model, which is also known as the Internet reference model. (DoD stands for Dept. of Defense – the name is a throwback to the origins of the Internet in DoD-supported research in the 70's and 80's.). This is the commonly employed model, and we consider only this model in this course.
An alternative model, developed by the OIS (Organization of International Standards), called the OSI (Open Systems Interconnect) model, commonly referred to as the OIS/OSI model, consists of seven service layers:
7.) Application- |
6.) Presentation |
5.) --Session--- |
4.) -Transport-- |
3.) --Network--- |
2.) -Data Link-- |
1.) --Physical-- |
Here's a brief description of each layer in the OIS/OSI model:
7.) Application Layer: The Application Layer can include things like web browsers, SSH clients/servers, etc.
6.) Presentation Layer: Other than data sent/accepted to/from the application layer and Session Layer, this layer is reserved for certain kinds of data manipulation or consistent data types being encapsulated for transmission. Translations could possibly be made between ASCII and Unicode or even EBCIDIC if hexadecimal values for letter were being transmitted.
It is the presentation layer that is also able to exchange messages and often dynamically create a syntax that is shared by it and its peer layer service on the remote stack.
Also included within this layer is Security in the form of encryption (if used) and compression.
It is this layer that requests the creation of sessions, and requests the termination of sessions.
5.) Session Layer: This section is one of the most often misunderstood sections since it does not have an obvious separate protocol when people try to apply it to a common layered system that may use TCP/IP or IPX/SPX. Often with these protocols and protocols on top of these protocols, layer boundaries are not so obvious.
This layer deals with creating a session, transmission of data, and then tear down of the created session. Sessions are created and terminated at the request of the Presentation Layer as it has data needing to be passed on to a different location.
4.) Transport Layer: This layer is responsible for many things that individually may not seem exceptionally important but actually provide for some critical needs.
This layer, just as all layers, accept data from layer immediately above and below it (except for layer 1, and layer 7) as well as provide services for the layers above them (except for Layer 7.) In this case, the Transport Layer must create a connection of the type needed by the Session Layer for each connection requested by the Session Layer. In cases where data being pushed down this model towards this layer is larger than the maximum allowed size of packets for this layer, it is up to this layer to re-size the incoming data from above. It does this by breaking the larger sized data from the layer above into smaller sizes that may fit within packets for this layer. The peer level Session Layer then re-creates the larger sized data for its upper layer by connecting payloads of separate packets together in a "stream".
The bulk of the work done by this layer includes keeping track of multiple connections that may be taking place at any one time and keeping the incoming and outgoing packets properly addressed to be relayed to their respective desired locations. It may use a form of multiplexing to allow each connection to be properly directed to its intended interface/location in the Session Layer.
If a higher layer requires that a connection be created that is "reliable" (able to notice an error and then correct for the error so that all data sent eventually arrives at its destination) and the above layer cannot provide its own method of ensuring a "reliable" connection, then it is up to this layer to create a "reliable connection" that ensures all data sent eventually arrives.
If a "reliable" service is not required, but instead an "unreliable" connection is desired, then it is up to this layer to ensure that the packets arriving are the same as the packets that were sent, or else they are discarded. This can be performed by a number of ways, but the most common is to use special checksums (explained in a lower layer below this.)
If any order processing of data is needed to ensure packets coming in are assembled in the right sequence, then it is at this layer that this occurs. A special sequence number of sorts may be included in each packet transmitted by the sender. This sequence identifier allows the receiver to know what order to send payloads of incoming packets on up to the next higher layer. This helps to ensure payloads do not get re-ordered from transmitted sequence.
Regardless of which method (reliable or unreliable) is used, it is up to this layer to provide enough information in the packets to ensure the order is known and packets are free of errors. A "reliable" connection looks to get new copies of damaged packets while an "unreliable" connection looks to discard the errors. A "reliable" connection would wait for packets missing in a sequence before continuing. An "unreliable" connection may just discard packets that arrive out of sequence and continue passing on the payload of packets in a sequential order that may skip occasional packets arriving out of order.
As a final requirement, like other layers, this layer is supposed to insulate the other layers from changes made to it. Say for example a new media is used, that may effect the Physical Layer and the Data Link. If the interface for the data link layer is coded to offer the same services to the Layer above, upper layers are not impacted by changes made to layers below. This allows for advancements to be made in any layer to replace previous implementations without causing serious impacts requiring the whole stack of layers to be recoded.
This layer acts much like a shipping warehouse supervisor. The supervisor must know the source of a package needing to be sent out as well as the destination. The supervisor must find a box in which the package will fit. If the package is too large to fit into the box, the supervisor must break the package into smaller parts that may fit into the box. This supervisor also may date or time stamp the boxes holding the packages so the receiver will know in what order the packages inside the boxes were shipped. If a recipient needs to reply to the original sender they send their package back to the company where we have our trusty supervisor. This supervisor examines the package to see who sent it, and who in the organization should be getting the return package. Some people in his organization may care if the package arrives, and want to know who picked it up, so they may asked for the supervisor to send the package "Registered Mail" with "Return Receipt Requested" to know the package did arrive and who picked it up. Some people in his organization are just sending out bulk advertisements and if the little junk mail cards get munged in the postal system to the point they cannot be read, oh well. If after our supervisor notices packages are piling up and not leaving fast enough to certain destinations only served by "Cheap & Slow Mail Service" he may decide to hold off on trying to send too many boxed packages through that system too quickly for fear of them being lost.
In the above analogy, the organization is the Session Layer, and the shipping supervisor is the Transport layer. The supervisor decreases the sending of packages to slower mail carriers (flow control.) The supervisor keeps track of who in their organization is sending out a package with source addresses so as to know who a response on that package should be sent for each person in the organization that is presently sending packages outside the organization (multiplexing). The supervisor chops packages that are too large into smaller pieces that fit in the boxes the supervisor has on hand (packetizing of payload in sizes allowed by Transport layer protocol.) Each member of his company may send multiple packages and notices to anyone in the world that can get mail and strike up conversations as needed, but the supervisor must keep track of each transaction (creating connections as needed by the Session Layer.) If suddenly, the shipping system went over to using personal Jets to fly things to destinations, the people at the organization need not do anything differently (Session Layer is insulated and not inconvenienced by changes made in hardware at layers lower than it.) Reliable transport is effected by use of registered mail and return receipt requested. "Unreliable" mail is sent out in bulk, and if it gets lost along the way, becomes broken, or no longer valid, it may be discarded and nobody is blamed. If the supervisor is told that the packages needed to be shipped to a destination are done for now, the supervisor can then forget about that connection between a member of the supervisor's organization and the outside world and focus on the other connections being made by members of their organization, and incoming connection requests from outside organizations.
3.) Networking Layer: It is the opinion of one of my associates that this layer is potentially the most complex of all the layers due to the issues that it must address. Most importantly: routing. This layer is responsible primarily with routing of data from the layer above (Transport Layer) to a remote location that may or may not share the same Physical Layer-direct-link, or even Data Link Layer protocol. Issues in differences in the commonly referenced name "bandwidth" to describe the size of an imaginary pipe for pushing data from one point to another as if it were liquid in a real pipe, are also address here at this layer. Just as the Data Link Layer below must ensure that a fast sender does not flood-out a slower receiver and possibly lead to lost data, this layer also must address problems that may exist when a stream of packets coming form a network with unused big pipes encounters a possibly busy network with small pipes. Even in the case where two networks both have the same sized pipes, a network with a pipe that is almost full may have difficulties in passing on incoming packets from a network with a pipe that is nearly empty.
Other issues that are resolved by this layer include dealing with packet sized in the case of dissimilar settings, or protocols between networks forcing the size of a packet to become smaller before being passed on (called fragmentation in IP of the TCP/IP suite of protocols).
Often some sort of accounting mechanisms are included at this layer to allow a network administrator to see how many packets, bytes, and various numbers of different sized packets may have been transmitted. Though it is not an absolute necessity to the function of this layer, it does often provide statistical data for making charges to parties, optimizing links and arguing for bigger more expensive pipes, or smaller cheaper pipes, or bigger slower pipes, or smaller faster pipes. It can be one thing to tell your boss you need a bigger pipe, and it is entirely another to show your boss you need a bigger pipe.
2.) Data Link Layer: This layer is responsible for creating what appears to the layer above (Network Layer) as a channel that is free of detected errors. Often this is done by packaging bits into cells, or frames, or generically "packets" with a predictable beginning and end and special calculations performed on the data known as checksums.
It is necessary for the sender and receiver to agree upon the beginning and ends of packets so their transmission may be synchronized. The beginning of the packet may be known by both the sender and receiver based on a shared timing. For example (this one is not a real-case), a packet should be expected every second with a 1 second pause after each packet (synchronous). Another example may include using a special sequence of bits that act as a signature for the beginning of a packet and another special signature that acts as the end of a packet (asynchronous). With either system, it is possible for the sender and receiver to both know when a packet starts, and stops.
This layer resolves problems that may arise in the cases of duplicated frames, cells, or damaged packets being received, and knowing how to deal with them as well as the above mentioned checksum for finding bad frames, cells or generically packets. One solution may be to just drop the frame.
This layer needs to address problems that may exist where a fast transmitter from inundating the slower receiver with too many bits, too fast for the receiver to analyze them. The consequences of not addressing this could lead to dropped bits and data lost by the receiver.
Some examples of some protocols that operate mostly in the Data Link Layer include Ethernet, TokenRing, ATM, and PPP.
1.) Physical Layer: This layer is responsible for moving bits across a shared media between two points. Agreed upon specification by both parties involved (or all parties involved) on how a 1-bit and a 0-bit should be signaled. For what duration should an amperage, how a voltage signature proceeds in order for the sender to the receiver for it to "hear" the signal, and decode the signal back into the bits transmitted by the sender. If not a wired physical media, but instead a wireless system, then it would be this layer that specified what frequency of light or sound would be used and if luminous intensity or amplitude changed meanings of bits. This layer also specifies how the channel may be used: Full Duplex, Half Duplex, or Simplex. This layer also deals with conductor mapping in the case of wired media, and frequency/amplitude/cycle-offsets in the case of wireless media for mapping Reception and Transmission.