Concept of Layering in Networking
1.2 CONCEPT OF LAYERING
Divide and conquer is a well-known mechanism to solve complex problems. Networking is no exception. The entire networking problem is solved in pieces. These solution pieces are independent to a large extent. More importantly, they can evolve independent of each other without much trouble. Additionally these solution pieces are arranged in a way that one solution piece provides all that is required by another piece. That piece in turn provides whatever is required by another one and so on. All such solution pieces are called layers in the networking parlance. All these layers are arranged from top to bottom for pedagogy purpose. Each layer in this arrangement provides service to the upper one as mentioned earlier. Here each layer represents a specific networking service which is more or less. independent of other services. As mentioned earlier, these services are arranged in a way such that each service helps the next one in sequence. If we have sl, s2, s3, etc. as services, then s1 helps s2, s2 helps s3, and so on. We will have a simple analogy to understand the concept of layering in the following section.
1.2.1 Layering Example
Let us take a somewhat contrived example. Though contrived, the example is good enough to appreciate the underlying concept.
Assume a company ABC having a manager, a secretary, a route operator, a warehouse keeper cum security officer, and a transporter with a few trucks located at a place called A. The company is selling computers. Suppose the manager comes to know about an order from a company XYZ located at a place called B. The manager decides to supply computers for that order. Now look at what is happening. The manager passes the massage to the secretary that the company called XYZ from a place B has placed an order for 5000 units of computers. Both the manager and the secretary are comfortable with Hindi and discuss the issue in Hindi only.
Now the secretary writes a letter which has to be carried with the consignment, addressed to the secretary of XYZ. The letter indicates that the consignment of 5000 computers is sent. The letter also contains a request that as soon as the consignment and the letter reach the secretary of XYZ, the recipient should reply back to indicate acknowledgement of that letter as well as the consignment. This letter, as the secretaries are to communicate in English, written in English. This letter will only be opened when it reaches at the desk of the secretary of XYZ.
The secretary then calls the route operator and tells him to deliver the consignment to XYZ at place B. The secretary and the route manager may discuss everything in Punjabi.
Now the route operator's job starts. Let us assume he has the map given in Figure 1.1 and he tries to derive a route for the consignment looking at the map.
Look at the map given in Figure 1.1. ABC and XYZ are located at faraway places called A and B. To reach from A to B, there are three junctions to cross. The three junctions are R1, R2, and R3. The paths from A to R1 and R3 to B are normal roads where trucks can operate to carry the consignment. From R1 to R2, there is a railway track. Between R2 and R3, there is a river flowing in between. So to reach from R2 to R3, we need to use a boat.
Assume that ABC has its transport offices at R1, R2 and R3. We also assume that the route operator is aware of the topology (the way the roads and the railway tracks are laid out). In other words, the route operator has the idea about the path and has the map with him. So he can decide to send the consignment to R1 whenever the destination is B. The map contains only one path but in a real case, there may be more than one path between any two places in the map. Suppose the terrain suffers from heavy traffic jams, then he should have the latest map which displays only those paths which are available and not others where there may be traffic jams. For the time being, we ignore all such complexities and assume that the entire path is open for communication. Thus the route operator decides to follow the path shown in Figure 1.1.
When the route operator thinks that the path outlined in the map is the route to be chosen, he must manage to send the batch of computers to R1. R1, being an intermediate destination, must be able to forward the consignments sent to it.
Now, the route operator, after deciding to send the consignment to R1, tells the warehouse keeper cum security officer to collect 5000 computers from various warehouses and send them to R1. He also asks to paste a label on each component of the consignment as From: ABC and To: XYZ.
Now the warehouse keeper cum security officer decides to send these 5000 computers from the warehouse and decides that one truck can carry 500 such computers together. He prepares ten big boxes that can carry 500 computers each. Now each truck can carry one such box. Each box is labeled as From: ABC and To: RI. It is interesting to see that the computers themselves are also labeled but as From: ABC and To: XYZ.
The label on the box also contains details about the computers as Quantity (500), Checked By (The name of the person who checked them), Content (Computers), etc. Now the warehouse keeper instructs the transporter to carry the consignment to R1. The transporter now instructs the truck drivers. The truck drivers carry them in trucks one by one to R1. They load the consignment at A and unload them at RI. They may use any truck that is available for the job.
The transporter at R1 receives the trucks, each having a box containing 500 computers. He verifies the sign on the box and inspects its contents. He should open up each box. He must check if the destination is on his network before doing so. He should also verify the sign on the container beforehand. Then he opens up the box and takes the computers out. He may even count them and verify with the number on the container box. If everything is in order, then he passes these computers to the warehouse keeper to store them until the scheduled train arrives. The warehouse keeper at R1 contacts the route operator at R1 to decide the route. The route operator confirms that his network itself is not the destination. He then finds out what the real destination is for these consignments.
The router operator is in contact with other route operators and is aware of train schedules as well as other modes of transport (which we are ignoring at the moment). He chooses the train as the best route to XYZ. It is possible that the train runs just once in a week and the computers are needed to be stored for a few days. He passes this information to the warehouse keeper. The train compartments are of different sizes, so the warehouse keeper needs to pack 1000 computers in a single compartment and he needs to get five such compartments booked till R2. The warehouse keeper passes this information to the transport manger there. The transport manger now manages the loading process at R1. The transporter at R2 should manage the unloading part.
The example continues for the transportation of all these computers from R2 to R3 and finally from R3 to XYZ. The final part is a little different. When the route operator reads the receiver's address, he comes to know that the address is his own. He also find out from the content that a specific secretary has to receive the consignment and acknowledge the sender. The concerned secretary at XYZ reads the letter from ABC's secretary and writes a reply letter. This reply letter also confirms the delivery of computers. The secretary of XYZ also passes this information to his manager. The acknowledgement letter will reach the secretary of ABC and then the manager of ABC will come to know that the order is completed.
The example ends here. Now let us discuss how this simple example helps us understand the advantage of having layers in a networking environment.
1. The work of each employee is clearly defined. For example, what the manager expects from a secretary is clear. The manager passes the information of sending the computers to the secretary and expects an acknowledgement after the order reaches its destination. Similarly the secretary makes sure that the secretary at the other end gets the delivery letter and sends an acknowledgement. Similarly, everyone has their jobs clearly defined. This is a great thing to have because we can easily replace anyone of them with a new employee without affecting the efficiency of the overall process. More importantly, if the new employee has a different style of functioning, then we do not have to change the working style of other employees. One more important advantage is that when the job is clearly divided, the complex job becomes manageable.
2. Every employee is either providing or taking a service from somebody else, or doing both. The manager takes service from the secretary, the secretary takes service from the route operator, and the route operator in turn takes service from the warehouse keeper, and the warehouse keeper from the transporter.
3. The example does not fit into real world scenarios. We do not have route operators or warehouse keepers to handle packing-unpacking jobs. The transporter usually does the job. We have distributed the work amongst the three of them for a purpose. The purpose will soon be clear.