LESSON – 6 MAC ACCESS SUB-LAYER
LESSON 7: NETWORK LAYER Contents
7.0 Objective 7.1 Introduction
7.2 Design issues in Network Layer
7.2.1 Store and forward packet switching 7.2.2 Service provided to the transport layer 7.2.3 Execution of connection less services 7.2.4 Execution of connection oriented service
7.2.5 Comparison of virtual circuit and datagram subnets 7.3 Routing Algorithms
7.8 Model Question/ Self answering questions 7.0 Objective
The main responsibility of the network layer is to forward the data packets from the source all the way to the destination. In this lesson students will learn design issues of the network layer and challenges which are associated with it. Students will also get knowledge about various routing algorithms such as shortest path routing, flooding, DVR, Broadcast routing and multicast routing algorithms. After learning about these algorithms students will be able to discuss flaws and advantages of these algorithms, so depending on their requirements they will be able to choose the correct algorithm for their network.
7.1 Introduction
To reach up to destination a lot of barricades may occur along the way to route from source to destination. Network layer deals with end to end transmission of data packets.
To attain this aim network layer must get to know the path for which it has to send data packets i.e. it should know the network topologies and an appropriate path to route data packets for all the networks. This thing must also be kept in kind while forwarding the
packets is which path they are following and why they have chosen this path for forwarding data packets because in many cases a lot of problems may occur like overloading of data packets, congestion, bad path and many more. Even this is more difficult when data packet needs to be forward in different network because each network follows their own topologies and have their own. This is up to the network layer how to deal with it. In this lesson we will study all the issues and problems those are associated with network layer.
Figure 7.1 Computer Networks 7.2Design issues in Network Layer
Network layer is responsible to perform the following tasks
Determining addresses or translating from hardware to network addresses. These addresses may be on the same (local) network i.e. source and destination computers belongs to same network or elsewhere the addresses belong to different networks which is known as internetworking.
Getting to know addresses between sender and receiver nodes or between 2 intermediate nodes.
Maintaining l physical or logical connection between sending node and receiving node, this connection may be either connection-less network or connection-oriented network.
Understanding the phenomena of OSI and TCP/IP models. Each layer has its own responsibility in computer networks. As the network layer is succeeded by transport layer and preceded by data link layer. The data is processed and transmitted using data link layer below the network layer. Guarantee for successful delivery of data packets is responsibility of transport layer which uses network layer’s services.
The network layer controls the operation of subnet (Network with-in a network). Sending of data packets over the network can be either static or dynamic depending on the route that network layer choose. In selection of static network routes are well defined and rarely changes. In dynamic network routes can be judged dynamically.
When a packet has to travel from one network to another to reach its destination many problems may occur.
The topologies and addressing used by destination network may be different from source network. Destination network may or may not accept the packet due to any reason.
Protocols may be different. So, this is all up to network layer to overcome all these problems in a simple manner.
Here we categories design issues of network layers in four parts.
Interface between the source (host node) and the destination (receiver node).
Network layer is a typical boundary between the host and subnet.
Routing
Congestion and deadlock
Internetworking (source and destination belongs to different networks like Ethernet, point to point links etc.)
The network layer is responsible for routing packets from source to destination.
Summing up the above conversation the network layer performs these basic functions.
Routing: - Thephenomena of sending the received packet from data link layer to the correct destination are known as routing. This operation makes decision at each step that where to send the packet next and to which node so that the packet reaches its destination eventually. The node which makes this decision is known as router (which routes the packet from source to destination). For routing we require some nodes of addressing recognized by network layer.
Inter-Networking: - When the sending node and receiving node belongs to different networks then the connection between them is known as inter-networking. Thus if two physically different networks needs to communicate the data packet which arrives at data link layer of the node which connects these two physically different networks would be stripped of their headers and passes to the network layer.
Congestion control: -If the packets coming to the router are more than the outgoing rate then congestion is said to be occur. There are many factors which are responsible fro congestion to occur. Some of these are
If at the same time a lot of packets begin arriving and all of them need the same output line.
If the node have in sufficient amount of memory
Slow processors
Low bandwidth And many more
Check your progress/ Self-assessment questions Exercise-I
Q1. What is connection less and connection oriented services?
Q2.What is the purpose of network layer?
a. Routing
b. Inter-networking c. Congestion control d. All of above
Q3. The node which makes decision about routing of data packets is known as router a. True
b. False
7.2.1 Store and forward packet switching: - The store and forward packet switching approach is based on the storing the data packet inside the carrier and forwarding it to the destination node.
Figure-7.2
Store and forward packet switching
As it is shown in the figure inside carrier there are a lot of nodes attached with each other, there we have a H1, processor P1which is the sender and H2, processor P2 which is receiver and inside carrier rectangular 1 is the packet which is needed to be transmitted, here D is the router which takes decision about transmission of packet. All the nodes A B C D E and F are connected to each other but F node is not a part of carrier which is connected to the receiver H2. Packet will be sent to node D which is acting as router and D takes decision of routing data packet which finally reaches at H2 destination.
7.2.2 Service provided to the transport layer: - The network layer and transport layer creates an interface and the network layer services have been designed with the following things in mind.
The services should not be dependent to which the router is adapting
The transport layer must be sheltering from the type, number and the topologies which the router is adapting.
The transport layer must allocate the network addresses and must use a uniform labeling plan on LAN & WAN’s.
The network layer should provide connection less services or connection oriented services. The internet offers connection less network layer services; whereas ATM networks offers connection oriented network layer services.
7.2.3 Execution of connection less services: -As we have already discussed, in connection oriented services the acknowledgement is received and in connection less service there is not any fixed path established between source and destination. Connection oriented services follows the example of telephone line.
In this context the data packet is called a Datagram (in analogy with telegram) and subnet is called Datagram subnet.
As shown in figure here the process P1 needs to send data to process P2 and as shown in tables the immediate two nodes of A is B and C. let us say the data which will be transferred is too long and it is divided into four packets then each packet will be sent one by one and immediate nodes will send the packet to next node as shown in the figure.
Each node’s table is shown.
Figure 7.3
Execution of connection less service
7.2.4Execution of connection oriented service: -If connection oriented service is to be used to transfer the data packets from source to destination, a well-established path must be there. This path is known as virtual circuit (VC).With the physically circuit set up by the telephone system. The subnet is called Virtual circuit subnet (VCS).
As shown in the diagram here we have three hosts H1, H2, H3 and each host can establish connection with each other as here is a well-defined path and each node has its own table, considering the some situations as discussed above the data packets are divided into four parts and nodes will transfer the data packet to its next immediate node followed by another as already established in table.
Figure 7.4
Execution of connection oriented service
7.2.5 Comparison of virtual circuit and datagram subnets: - Although datagram and virtual circuits have their own advantages and disadvantages. We will summarize the concept in table listed below.
Since we have certain advantages of using virtual circuits over datagrams.
Check your progress/ Self-assessment questions Exercise-II
Q1. What is datagram?
Q2. What is datagram subnet?
________________________________________________________________________
________________________________________________________________________
______Q3. What is virtual circuit?
Q4. Virtual circuit network has advantages over the datagram?
a. True b. False
7.3Routing Algorithms: - The primary purpose of network layer is to route packets from host to destination machine so, the algorithm choose that routes and the data structure that they are using as a major network layer design.
The routing algorithms are an important part of network layer software which decides on which outgoing line the incoming packet should be transmitted. If the subnet uses
datagram then the decision will be made every time a new packet arrives but if the subnet uses virtual circuits the path must be already established.
7.3.1Properties of routing algorithms: - Here we have some properties those are always desired from routing algorithms
Correctness
Robustness
Simplicity
Stability
Fairness
Optimality
Correctness: - Routing must be done exactly and properly that the data packets should reach at exact destination
Robustness: -It is not possible for network designer to design network each time the data packets has to send. As far as major networks are concerned a good network must be designed which can overcome the problems and run continuously for years to come. It should be capable to adapt hardware, software and topologies changes.
Simplicity: - The routing algorithm should be simple so that packet reaches their destination. It should have low complexity.
Stability: - The routing algorithms must remain stable under all circumstances.
Fairness: - All the nodes should get proper chance to transmit their packets on any basis, generally it is done on FCFS (First come First serve) basis.
Optimality: - The routing algorithms must be optimal in terms of throughput and minimizing the packet delays. Centralized
7.3.2Classification of Routing Algorithms: -
Figure 7.5 Routing algorithms
Adaptive routing algorithms use dynamic information as current topologies, delays, load etc. to select the route.
Non adaptive routing algorithm does not changes their paths once selected. They are also called static routing.
7.3.3Shortest path routing: - Shortest path routing is a type of routing algorithm which always choose shortest path to send packet of data over a network in such a way that the path from host to destination should be minimized. It uses non-adaptive routing algorithms.
As shown in figure the network is represented as a graph with its terminal nodes and the links edges. Each edge is associated with some length which represents the cost of link for transmission. Shortest path routing algorithm works on phenomena “Lower the cost, more suitable is the link”.
The destination path is from A to D. we are starting from A then A to B then B to E then E to F then F to H and finally H to D which is the minimum cost.
Routing Algorithms
Adaptive
Isolated
Centralized
Distributed
Non-Adaptive
Floodind
Random Walk
Shortest path from A to D is A B E F H D
Figure 7.6
Shortest path routing algorithm
Some ways of decreasing cost is
Minimizing number of hops
Transmission and propagation
Queuing delays
7.3.4 Flooding: - Flooding is that type of routing algorithm in which the incoming data packet is sent to every outgoing node apart from the node on which it originated. A lot of problems may occur due to this algorithm like
Duplicate packets
Packets may go in loop
As a result nodes will receive several copies of single packet which is not a good deal.
Figure 7.7 Flooding algorithm
To overcome these problems we have some techniques
Sequence number: - Each data packet will be given a sequence number. When the receiving node receives the data packet it will see its source address and sequence number. If the node gets to know that if it is the same packet which was received earlier the packet will be discarded.
Hop Count: - Each data packet will have a hop count with it that will be decremented or incremented by one when nodes get it. When this hop count comes to zero the data packet will be discarded.
Flooding has many important uses as well
In defense applications the network remains robust in extreme conditions.
Choose the shortest path because it approaches all paths.
Check your progress/ Self-assessment questions Exercise-III
Q1. List properties of routing algorithms?
Q2. How cost can be decreased in shortest path routing algorithm?
Q4. What problems occur in flooding routing algorithm?
7.3.5Distance vector routing algorithm: -we know distance vector algorithm with two other names. Commonly named as Distributed BellmonFordrouting algorithm and the Ford Fulkerson routing algorithm because of researches that developed it (Bellmon, 1957 and Ford Fulkerson, 1972). It was also used in internet under the name RIP.
Some features of Distance vector routing (DVR) algorithm are as follows
Every router share the knowledge of other system
Neighbors share the information
At every thirty seconds router updates their information which are fixed regular intervals
In distance vector routing algorithm every router finds the distance between itself and all the possible neighbours. Here we have three keys to understand how this algorithm works
Knowledge about the whole network
Routing only to neighbors
Information sharing at regular intervals
This algorithm can be easily understand by the following diagram
Figure 7.8 (a)
Distance vector routing algorithm
Here we have six nodes and all the nodes are sharing information with its 132neighbours and it keeps record of network ID, cost and next hop in a table like
Network ID Cost Next Hop
-- -- --
-- -- --
-- -- --
-- -- --
The original table of A will be combined the inputs received from B and A’s new table will be formed
Figure 7.8 (b)
Distance vector routing algorithm
And then final diagram of DVR is
Figure 7.8 (c)
Distance vector routing algorithm
7.3.6Hierarchical Routing: - Sometimes we face some networks which are very large in size and obviously there routing table expands proportionally. In such situations a lot of bandwidth and CPU time is needed to send statistics and status report about them.
Sometimes it becomes very difficult to keep record of all the entries to the router. In these situation the routing will be done hierarchically just like telephone network. In which we divides areas into regions then regions into clusters and zones and finally the zones into groups. Where all regions know only their own internal structure. Here various networks are interconnected to form a hierarchical structure.
As shown in diagram
Region 1, 2, 3, 4 and 5 all the regions have different structures. All the regions are interconnected so, the host node is 1A and destination node is 5E. using the simple criteria we will get the full A’s table which have 17 entries but when we make it hierarchal it reduces to 7 entries which is the benefit of using hierarchical routing algorithm.
Figure 7.9 Hierarchical algorithm
7.3.7 Broadcast routing algorithm: - There are a lot of applications where the host computer needs to send data packets to all the computers in the network or inter-network.
For example weather reports, stock market alerts, service distributing. In this type of situations we will broadcast routing algorithm which broadcast the message to all the computers. For this a host must know the bandwidth and the cost of destination.
Figure 7.10
Broadcast routing algorithm
7.3.8 Multicast routing algorithm: - Some applications which needs multiple computers to participate at the same time. In these situations we should send data packet immediately so that the computers connected to each other should communicate in a well manner. For this we need high bandwidth. This connection could be expensive.
Examples are multiplayer games, video streaming, video conferencing, sports events live streaming etc.
Check your progress/ Self-assessment questions Exercise-IV
Q1. What is hierarchal routing algorithm?
Q2. What are two other names of DVR algorithm?
7.4 Summary
If sender and receiver both are on same network then network is called direct network other network is called indirect network.
Multicast is sending the data packets to more than one receiver concurrently.
ping ( Packet InterNetGroper) is a command that uses the services of ICMP to reach check the connection between sender and receiver.
Logical addresses can be mapped with physical addresses either statically or dynamically.
Delayed response strategy saves unwanted traffic upon LAN.
7.5 Glossary
OSI: Open System Interconnect.
TCP/IP: Transmission Control Protocol / Internet Protocol SPR: Shortest Path Routing Protocol.
DVR: Distance Vector Routing Protocol.
Connection less networks:The routing decisions are made for each datagram and there is no guarantee for acknowledgement
Connection oriented networks:The decisions are made once at circuit set up time and acknowledgement is guaranteed.
7.6 Answers to self-assessment questions Exercise – I
Answer 1. For connection less networks, the routing decisions are made for each datagram and there is no guarantee for acknowledgement
For connection oriented networks the decisions are made once at circuit set up time and acknowledgement is guaranteed.
Answer 2. All of above Answer 3. True.
Exercise – II
Answer 1.Data packet is called datagram
Answer 2. Sub-Network is called datagram subnet.
Answer 3. True Exercise- III
Answer 1. destination then cost will be reduced in SPR algorithm.
Answer 3.
Duplicate packets
Packets may go in loop Exercise –IV
Answer 1.Sometimes we face some networks which are very large in size and obviously there routing table expands proportionally. In such situations a lot of bandwidth and CPU time is needed to send statistics and status report about them. In these situations we choose hierarchical routing algorithms.
Answer 2.
Distributed Bellmon Ford routing algorithm
Ford Fulkerson routing algorithm 7.7 References/ Further readings
1. Computer Networks, Andrew S.Tanenbaum and David J. Wetherall, Fifth Edition, Prentice Hall Publishing company.
2. Data Communications and Networking, BehrouzA.Forouzan,Fourth Edition, Tata McGraw Hill publishing company, New Delhi
7. 8 Model questions/ Self answering questions Q1. List some properties of routing algorithms
Q2. How connection less and connection oriented services are different.
Q3. Explain all the design issues in network layer.
Q4. How virtual circuit is different from datagram subnet Q5. What are various types of routing algorithms?
Q6. Explain distance vector routing algorithm with example.