University topic explanations and practice

University › Software and Informatics › Computer Networks

Network Architecture and Layered Models

Explains why network functions are divided into layers and assesses the benefits of abstraction. The seven-layer reference model and four-layer Internet model.

Save your progress

Learning Outcomes

Topic Explanation

What network architecture is and why it is layered

A computer network is a communication structure established to enable independent computing devices to exchange data. This structure consists not only of cables and devices; Which data will be sent in what format, how the error will be understood, which address corresponds to where and which application expects which data are also part of the same structure. Every decision in architecture affects other decisions. Therefore, network design is not considered as a single huge process, but is divided into subtasks connected to each other by defined interfaces.

The main rationale for layering is to manage complexity. An application does not need to know at what electrical level its data will be transferred over the wire; Likewise, the hardware driving the cable does not know what message the user is typing. Each layer performs only its own task and addresses the layer below it with a defined service call. Thanks to this distinction, changes in one layer do not necessarily affect the others; For example, when the transmission medium changes from copper to optical fiber, the software of the upper layers may remain the same.

A second benefit of layered structure is learnability and debugging. When communication cannot be established, one may ask at what level the problem is: is the cable plugged in, is the address resolved, is the connection established, is the application responding? Each of these questions corresponds to a different layer. The student learns to systematically investigate network problems by proceeding layer by layer rather than in random experiments.

Abstraction, service and interface concepts

There are three concepts that make up the language of the layered model: service, interface and protocol. A service is the set of functions that one layer offers to the layer above it; For example, the data link layer provides frame transport services between neighboring nodes. The interface defines with which calls and with what parameters this service will be used. Protocol is the rules that two parties at the same layer follow when talking to each other. These three should not be confused: the service operates in the vertical direction, the protocol in the horizontal direction.

Abstraction is when the upper layer does not see the details of the lower layer. When an application sends data, it does not know which wire the packet will exit on; It only indicates the address of the other party and the service to be used. Thanks to abstraction, the same application can run on different networks. But abstraction is not free: each layer adds its own control information, and this overhead increases the total amount of data. The engineering decision is to balance the required service with the acceptable overhead.

Whether the service provided by a layer is reliable or not is also an important design choice. Some layers choose to report losses and errors to the upper layer, while others choose to do their best without any assurance. As reliability increases, latency and overhead generally increase as well. Therefore, in real systems, different layers offer different levels of reliability, and the upper layer selects the appropriate service according to its needs.

The seven-layer reference model

The seven-layer reference model divides network functions into physical, data link, network, transport, session, presentation and application layers. It is not a model product or mandatory application, but a common language; It is a conceptual framework that makes it easier for different systems to understand each other. The physical layer deals with electrical and mechanical properties; the data link layer manages frame transmission between neighboring nodes; The network layer ensures that the packet reaches its destination across networks.

The transport layer orchestrates end-to-end data transfer between two application processes; It can provide connected or disconnected service depending on delay sensitivity. The session layer deals with establishing, maintaining and terminating the conversation between two parties. The presentation layer takes care of representation issues such as data format, encoding and encryption. The application layer contains processes that directly serve the user.

The number of layers in the model is not arbitrary, but it is not absolute either. Some real protocol stacks include session and presentation functions within the application layer. Therefore, the seven-layer model allows us to think about which function occurs at which level rather than describing real applications exactly. In exams and design discussions, the place of function is taken into account; Memorizing the layer name alone is not enough.

The four-layer Internet model

The commonly used model of real networks consists of four layers: network access, internet, transport, and application. The network access layer covers the physical medium and frame transmission within the local network; It combines the functions of the physical and data link layers in the reference model. The Internet layer is responsible for routing packets between different networks and mainly carries addressing and routing functions.

The transport layer regulates data transmission between source and destination applications; connection management, ranking, approval and flow control are handled in this layer. The application layer is a large layer that covers the functions of the session, presentation and application layers in the reference model. This unification makes the model simpler and closer to real protocol families.

Matching between two models is a subject that students often confuse. Session and presentation functions, which are separate in the reference model, are generally implemented at the application layer in the Internet model. Likewise, the network layer of the reference model and the Internet layer of the Internet model refer to the same function with different names. Knowing this mapping makes it easier to determine at which layer a protocol operates.

Encapsulation and transformation of data units

Encapsulation is the wrapping of data coming from the upper layer with a header by the lower layer. Application data turns into segments at the transport layer, becomes a packet at the internet layer, is placed in a frame at the network access layer, and finally turns into a sequence of bits to be sent to the physical medium. Each layer only adds its own header, leaving the data of the upper layer untouched. On the receiving side, this process works in reverse; each layer reads its own header, extracts it, and passes the remainder onto the top.

Header information is control data carried between layers. Source and destination addresses, sequence numbers, error checking fields and service type indicators are included in the headers. Header size is part of the total data to be transmitted and should be taken into account in efficiency calculations. The header rate may be high on small packages; therefore, the choice of packet size for efficient transmission is a design decision.

Decapsulation, which is the opposite of encapsulation, occurs in the receiver. The receiver extracts bits from the physical medium into frame, from frame to packet, from packet to segment, and from segment to application data. At each step, the relevant header field is checked; If there is an error, the package may be discarded or resending may be requested. Thanks to this mechanism, the application reaches clean data without ever seeing the complexity of the lower layers.

Protocol stack and peer-to-peer communication

A protocol stack is a layered array of protocols that work together for the same communication on a device. Each layer of the stack uses the service below it and provides services on top of it. Two devices do not need to use the same protocol stack to communicate; They just need to have common rules that mutual layers understand. This feature enables communication between different operating systems and different hardware.

Mutual conversation is when protocols at the same layer of the sender and receiver mutually accept each other as interlocutors. The sending transport layer and the receiving transport layer behave as if they were talking directly; in reality, data passes through all layers in between. This ease of thought greatly simplifies protocol design and debugging.

The definition of a protocol consists of three basic elements: syntax, semantics and timing. Syntax determines the format of the data, what semantic fields mean, and timing determines the order in which events occur. For example, in a connection establishment protocol, these three elements include which message to send first, in what situation to retry, and how long to wait.

Addressing and communication between layers

Two different address types are used together in network communication. The physical address identifies a device within the same local network and may belong to hardware. The logical address indicates which network the device is on and is used in routing decisions. Confusing these two address levels is a common mistake: the logical address specifies the final destination of the packet, while the physical address specifies who will deliver it to the next neighbor.

A packet reaches its destination by passing through multiple gateways. At each gate, the logical address is preserved, while the physical address is rewritten according to the next neighbor. Thanks to this behavior, the packet travels correctly between networks. The student should consider that router interfaces have different physical addresses and each interface may be connected to a different network.

At the application level, port numbers distinguish the communication parties. Multiple network applications can run simultaneously on a device; The port number determines which application the package will be delivered to. When address and port are used together, the two ends of a communication are uniquely identified.

Advantages and limits of layered design

The biggest advantage of layered design is resilience to changes. When the technology in a layer changes, only the relevant interface needs to be preserved; upper layers are not rewritten. This makes hardware development independent of software and accelerates the spread of innovations. Additionally, different applications that offer the same service can be used interchangeably.

On the other hand, the layered structure has some costs. Each layer generates additional headers, performs additional processing, and creates additional latency. In some cases, strict separation between layers reduces efficiency; In high-speed networks, the cost of header processing can account for a significant portion of the total latency. Therefore, in real systems, some functions are not repeated in more than one layer or are moved to hardware.

Exceeding layer boundaries is also a controversial issue. Some protocols handle the functions of more than one layer, or one layer directly reads the header field of another. Although this situation spoils the conceptual purity of the model, it may be acceptable in practice. The important thing is that the system works and is predictable; The model is not a goal, but a thinking tool.

Network topologies and layer mapping

Network topology shows how devices are connected to each other. In star topology, all devices are connected to a central node; In a ring topology, each device connects with two neighbors; In mesh topology, most devices are directly connected to each other. Topology selection depends on the balance between reliability, cost and ease of management. The layered model works on top of these topologies; No matter which topology is used, the same functional layers are preserved.

In topologies where there is a central node, the failure of the central device affects all communication. On the other hand, since there are alternative routes in the mesh structure, the loss of a single connection does not stop communication completely. Routing decisions are based on the existence of these alternative routes. The network designer establishes the balance between redundancy and cost through topology selection.

Layer thinking also allows topology problems to be classified. Physical layer failure is a cable or interface problem; data link layer failure is frame errors or address learning problems; Network layer failure is misdirection or unreachable destination. This classification enables a measurement-based approach to troubleshooting rather than trial and error.

Key Points

Worked Examples

Worked Example

Worked Example

Worked Example

Worked Example

Worked Example

Worked Example

Common Mistakes

Tips

Practice Questions

  1. 1. What is the main rationale for dividing the network architecture into layers?
  2. 2. What is the name given to the set of functions that a layer offers to the upper layer?
  3. 3. What are the rules that two parties in the same layer follow called?
  4. 4. In what direction does the service work?
  5. 5. In which direction does the protocol work?
  6. 6. In the seven-layer reference model, which layer deals directly with the physical environment?
  7. 7. Which layer's task is frame transmission in the reference model?
  8. 8. At which layer does packet forwarding occur in the reference model?
  9. 9. Which layer regulates end-to-end data transfer?
  10. 10. Which layer in the reference model deals with data format and encoding?
  11. 11. At which layer in the reference model is the establishment and termination of the conversation?
  12. 12. Isn't it one of the layers in the four-layer internet model?
  13. 13. At which layer in the Internet model do physical and data link functions merge?
  14. 14. At which layer is routing done in the Internet model?
  15. 15. Which layer in the internet model does the network layer of the reference model correspond to?
  16. 16. What is the data unit in the transport layer usually called?
  17. VOLUME 17 What is the data unit at the Internet layer called?
  18. 18. What is the data unit at the network access layer called?
  19. 19. What does each layer do during encapsulation?
  20. 20. Where does the capsule opening process take place?
  21. 21. Which of the following is not included in the header information?
  22. 22. What is the consequence of the high header rate in small packages?
  23. 23. Which address type is the hardware address of a device in the local network?
  24. 24. Which address indicates the final destination of the package?
  25. 25. Which address is rewritten when a package is delivered to the next neighbor?
  26. 26 What is the value that distinguishes different network applications running on the same device?
  27. 27 Isn't it one of the three basic elements of the protocol definition?
  28. 28 In a connection establishment protocol, which element defines which message will be sent first?
  29. 29 What is the most important advantage of layered design?
  30. 30 What is one of the costs of layered construction?
  31. 31 What does it mean for a protocol to take on the function of more than one layer?
  32. 32 Where are all devices connected in star topology?
  33. 33 What is the main advantage of mesh topology?
  34. 34 What happens if the central device of a central node topology fails?
  35. 35 What is the symptom of physical layer failure?
  36. 36 What is the symptom of network layer failure?
  37. 37 If a 1500 byte packet is transmitted at 10 Mbit/s, what is the transmission delay in ms?
  38. 38 How many ms will the propagation delay be at a distance of 500 km at a speed of 2 × 10^8 m/s?
  39. 39 If a 58 byte header is added to 1200 bytes of data, how many bytes is the total frame size?
  40. 40 Approximately how many kbit/s would the Shannon capacity be at 4 kHz band and 30 dB signal-to-noise ratio?
  41. 41 If 1000 bytes of useful data and 1100 bytes of total data, approximately what percentage is the efficiency?

Source: Inspired by open curricula of Turkish universities; the explanation is written originally.

Kaynak: Türkiye üniversitelerinin açık ders planlarından esinlenilmiştir; anlatım özgün olarak yazılmıştır.