1.5 – Protocol layers and Their Service Models
1.5.1 – Layered Architecture
- Each layer provides its service by performing certain actions within that layer and by using the services of the layer directly below it.
- A layered architecture allows us to discuss a well-defined, specific part of a large and complex system. This simplification itself is of considerable value by providing modularity, making it much easier to change the implementation of the service provided by the layer. As long as the layer provides the same service to the layer above it, and uses the same services from the layer below it, the remainder of the system unchanged when a layer’s implementation is changed.
- The ability to change the implementation of a service without affecting other components of the system is an important advantage of layering.
- Each protocol belongs to one of the layers.
- The services that a layer offers to the layer above-the so-called service model of a layer.
- The services provided by layer n may include reliable delivery of messages from one edge of the network to the other.
- This might be implemented by using unreliable edge-to-edge message delivery service of layer n-1, and adding layer n functionality to detect and retransmit lost messages.
- A protocol layer can be implemented in software, in hardware, or in a combination of the two.
- Application-layer: HTTP and SMTP, are almost always implemented in software in end-systems (transport-layer protocols too)
- Because the physical layer and data link layers are responsible for handling communication over a specific link, they are typically implemented in a network interface card associated with a given link.
- The network layer is often a mixed implementation of hardware and software.
- There’s often a piece of a layer n protocol in each of these network components.
- Protocol layering has a conceptual and structural advantages. Layering provides a structured way to discuss system components. Modulatory makes it easier to update system components.
- One potential drawback of layering is that one layer may duplicate lower-layer functionality.
- Second potential drawback is that functionality at one layer may need information that is present only in another layer; this violates the goal of separation of layers.
- When taken together, the protocols of various layers are called the protocol stack.
- The internet protocol stack consists of 5 layers:
- Application
- Includes many protocols as HTTP, SMTP and FTP
- An application-layer protocol is distributed over multiple end systems, with application in one end system using the protocol to exchange packets of information with the application in another end system.
- We call the packet of information at the application layer a message
- Transport-layer packet = segment
- Transport
- Transports application-layer messages between application endpoints
- Two transport protocols:
- TCP
- Provides a connection-oriented service to its application
- Includes guaranteed delivery of application layer messages to the destination and flow control
- Breaks long messages into shorter segments and provides a congestion-control mechanism, so that a source throttles its transmission rate when the network is congested.
- UDP
- Provides a connectionless service to its applications
- Provides no reliability, no flow control and no congestion control,
- Network
- Responsible for moving network-layer packets known as datagrams
- The transport-layer protocol passes a transport-layer segment and a destination address to the network layer.
- Provides the service of delivering the segment to the transport layer in the destination host.
- The Internet’s network layer includes the IP protocol (defines the fields in the datagram as well as how the end systems and router act on these fields)
- The Internet’s network layer also includes routing protocols that determine the routes that datagram take between sources and destinations
- Also referred to as the IP-layer.
- Link
- The network passes the datagram down to the link layer which deliver the datagram to the next node along the route. At this next node the link layers passes the datagram up to the network layer.
- The services provided by the link layer depend on the specific link-layer protocol that is employed over the link.
- Ethernet, WiFi, DOCSIS, etc.
- A datagram may be handled by Ethernet on one link and by PPP on the next link. The network layer will receive a different service from each of the different link-layer protocols.
- Link-layer packets = frames
- The physical
- The job is to move the individual bits within the frame from one to the next.
- The protocols in this layer is link dependent and further depend on the actual transmission medium of the link.
- OSI Model
- International Organization for Standardization proposed that computer networks be organized around seven layers, called the Open Systems Interconnection (OSI) model.
- Layers (5/7 are similar to the Internet protocol stack but the next two layers are between application and transport):
- Presentation
- Provide services that allow communication applications to interpret the meaning of data exchanged.
- Includes data compression and data encryption as well as data description
- Session
- Provides for delimiting and synchronization of data exchange, including the means to build a checkpointing and recovery scheme.
1.5.2 – Encapsulation
- Routers and link-layer switches organize their networking hardware and software into layers, but they do not implement all of the layers in the protocol stack; they typically only implement the bottom layers (Layer 1 and 2, routers implement layer 3).
- An application-layer message is passed to the transport layer. In the simplest case the transport layer takes the message and appends additional information that will be used by the receiver-side transport layer. The application-layer message and the transport-layer header information together constitute the transport-layer-segment.
- The transport-layer segment thus encapsulates the application-layer message.
- The added information might include information allowing the receiver-side transport-layer to deliver the message up to the appropriate application, and error-detection bits that allow the receiver to determine whether bits in the massage have been changed in route.
- The transport layer passes the segment to the network layer which adds network-layer header information such as soruce and destination end-system address, creating a network-layer datagram.
- The datagram is passed to the link layer which will add its own link-layer header information and create a link-layer frame.
- At each layer a packet has two types of fields. A header field and a payload field (typically the packet from the layer above).