The Network Layer
UNIT 3
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Network Layer:
Switching, Logical addressing – IPV4, IPV6; Address mapping – ARP, RARP, BOOTP and DHCP–Delivery, Forwarding and Unicast Routing protocols.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Position of Network Layer
N/w layer provides services to TL
N/w layer takes services to DLL
Transport Layer
Network Layer
Data Link Layer
Duties of N/W Layer
Inter Networking
Addressing
Fragmenting
Packetizing
Routing
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Network Layer Design Issues
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Store-and-Forward Packet Switching
The environment of the network layer protocols.
ISP’s equipment
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Store-and-forward packet switching:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Circuit Switching:
It is not flexible because once the path is set all the paths of the transmission follows the same path.
Ex: Telephone conversation
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Switching:
ii) Virtual Circuit Approach
It is a store and forward technique.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Properties of Routing Algorithm:
The packets are to be correctly delivered or not.
Ability of the n/w to deliver the packet via some route even in the phase of failure.
The algorithm should maintain stability or equilibrium in the phase of change in conditions in the n/w.
Obvious requirements
Minimum overhead
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Services Provided to the Transport Layer
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Implementation of Connectionless Service
Routing within a datagram network
ISP’s equipment
A’s table (initially) A’s table (later) C’s Table E’s Table
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Implementation of �Connection-Oriented Service
Routing within a virtual-circuit network
ISP’s equipment
A’s table C’s Table E’s Table
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
H1 | 1 |
H3 | 1 |
C | 1 |
C | 2 |
A | 1 |
A | 2 |
E | 1 |
E | 2 |
C | 1 |
C | 2 |
F | 1 |
F | 2 |
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Comparison of Virtual-Circuit �and Datagram Networks
Comparison of datagram and virtual-circuit networks
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses Classes
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IPV4 Header
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The IP Version 4 Protocol (1)
The IPv4 (Internet Protocol) header.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The IP Version 4 Protocol (2)
Some of the IP options.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses
IP address formats
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses
Special IP addresses
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 Goals
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (1)
The IPv6 fixed header (required).
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internet control messages
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ICMP
Internet Control Message Protocol (ICMP) is used for reporting errors and performing network diagnostics. In the error reporting process, ICMP sends messages from the receiver to the sender when data does not come though as it should.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
9.32
ARP (Address Resolution Protocol)
ARP Protocol
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
9.34
Figure 9.6: Position of ARP in TCP/IP protocol suite
9.35
Figure 9.7: ARP operation
9.36
ARP packet format
Hardware Type: This is to specify the type of hardware used by the local network to transmit the Address Resolution Protocols message. Once common hardware under this category would be the ‘Ethernet’ with a value equal to 1, and field size would be 2.
Protocol Type: To assign a fixed number in this field, IPV4 has a number 2048.
Hardware size: This is the length in bytes for the MAC address; generally, we see the ethernet has a MAC address of 6 bytes long.
Protocol Size: It represents the length of the IPV4 logical address, IPV4 address re generally 4 bytes long.
OpCode: This is the length of the logical address in bytes; it specifies the nature of the ARP message. An ARP Request has an assigned value of 1, whereas the ARP reply holds the value of 2.
Sender MAC address: Layer 2 address for the device sending the message.
Sender IP address: Protocol address in IPV4 for the device sending the message.
Target MAC address: Layer 2 of the intended receiver. This field does not hold any value during the request phase and works only during the reply phase.
Target IP address: This address the protocol address for the intended receiver.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ARP vs RARP
ARP: Address Resolution Protocol is a protocol used to map an IP address 32-bit to a physical MAC address 48-bit. The MAC address is known as the hardware id number. This is important in local area networks where devices need to know each other MAC addresses to communicate easily at the data link layer.
RARP: Reverse Address Resolution Protocol is used to map a MAC address 48-bit to an IP address 32-bit. This protocol is typically used by devices that know their Media Access Control address but need to find their IP address.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
DHCP�Dynamic Host Configuration Protocol (DHCP) is used to dynamically assign Internet Protocol (IP) addresses to each host on your organization‘s network.��The DHCP process can be explained using the acronym DORA, which stands for Discover, Offer, Request, and Acknowledge.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
DHCP Process
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
How to configure DHCP Server
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Bootstrap Process
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
BOOTP vs DHCP
Routing
Routing is the process of selecting the best path for data to travel across a network, from one device to another.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
�Routing Algorithm Metrics:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Routing Table:
UP flag : The U flag indicates the router is up and running. If the flag is not present, it means that the router is down. The packet cannot be forwarded and it is discarded.
Gateway flag: The G flag is the destination in another n/w the packet is delivered to the next hop router for delivery.
H flag: The H flag indicates the entry in the n/w address field in a host- specific address
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
D flag: The D flag indicates the routing information for the destination has been added to the host routing table by a redirection message for ICMP.
M flag:
The M flag indicates the routing information for the destination has been modified by a redirection message from ICMP.
This field gives no of users that are using the route at that moment.
This field shows a no of packets transmitted through the router for the corresponding destination
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Routing Algorithms:
In this type of algorithm routing decision is not based on measurement and estimation of current n/w traffic & topology. The choice of route is done in advance i.e offline and it is downloaded to the routers. This is called static routing algorithm. In this algorithm the routes are changed slowly. Ex: Optimality principle
shortest path routing: Dijkstra’s algorithm
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
In this algorithm the routing decision can be changed if there are any changes in the current n/w traffic and topology. This is called dynamic routing algorithm.
Ex:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Optimality Principle
(a) A network. (b) A sink tree for router B.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Dijkstra’s Algorithm:
An algorithm for finding the shortest paths between nodes in a weighted graph
It is a solution to the single-source shortest path problem in graph theory.
It works on both directed and undirected graphs. All edges must have non-negative weights.
Approach: Greedy
Input: Weighted graph G={E,V} and source vertex v € V, such that all edge weights are non-negative.
Output: Lengths of shortest paths from a given source vertex to all other vertices.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Dijkstra’s Algorithm:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Shortest Path Algorithm (1)
The first five steps used in computing the shortest path from A to D. The arrows indicate the working node
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Link State Routing
Each router must do the following:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Link State Routing
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Building Link State Packets
(a) A network. (b) The link state packets for this network.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Shortest path from A routing table
A->B 4
A->C 6
A->D 9
A->E 5
A->F 10
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Flooding
Definition:
Flooding is a simple computer network routing algorithm in which every incoming packet is sent through every outgoing link except the one it arrived on.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
DISTANCE VECTOR ROUTING
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Distance Vector Routing
(a) A network. �(b) Input from A, I, H, K, and the new routing table for J.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Advantages and Disadvantages
Advantages:
Disadvantages :
The count-to-infinity problem happens when a router is unable to reach an adjoining network
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Hierarchical Routing
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Hierarchical Routing
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Broadcast Routing
Method 1:A distinct packet is sent to each destination. This process wastes bandwidth.
Method 2: Flooding
Method 3: Multi dimensional routing
Method 4: Spanning tree
Method 5: Reverse Path Forwarding
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Congestion Control Algorithms (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Closed loop techniques�
Congestion control in virtual subnets
Congestion control in datagram subnets
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Warning bit
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Choke packets
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Hop-by Hop Choke Packets
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
A choke packet that affects only the source..
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
A choke packet that affects each hop it passes through.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Load Shedding
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Quality of Service
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Application Requirements (1)
How stringent the quality-of-service requirements are.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Categories of QoS and Examples
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internetworking
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
How Networks Differ
Some of the many ways networks can differ
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
How Networks Can Be Connected
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Tunneling (1)
Tunneling a packet from Paris to London.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Tunneling (2)
Tunneling a car from France to England
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (1)
Packet size issues:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (2)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (4)
Fragmentation when the elementary data size is 1 byte
(b) Fragments after passing through a network
with maximum packet size of 8 payload bytes plus header.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Network Layer Principles (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Network Layer Principles (2)
. . .
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Network Layer in the Internet (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Network Layer in the Internet (2)
The Internet is an interconnected collection of many networks.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (2)
Splitting an IP prefix into separate networks with subnetting.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (3)
A set of IP address assignments
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (4)
Aggregation of IP prefixes
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (5)
Longest matching prefix routing at the New York router.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (2)
IPv6 extension headers
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (3)
The hop-by-hop extension header for �large datagrams (jumbograms).
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (4)
The extension header for routing.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internet Control Protocols (1)
The principal ICMP message types.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internet Control Protocols (2)
Two switched Ethernet LANs joined by a router
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Label Switching and MPLS (1)
Transmitting a TCP segment using IP, MPLS, and PPP.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Label Switching and MPLS (2)
Forwarding an IP packet through an MPLS network
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway �Routing Protocol (1)
An autonomous system
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway �Routing Protocol (2)
A graph representation of the previous slide.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway �Routing Protocol (3)
The relation between ASes, backbones, and areas in OSPF.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway �Routing Protocol (4)
The five types of OSPF messages
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
BGP—The Exterior Gateway �Routing Protocol (1)
Examples of routing constraints:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
BGP—The Exterior Gateway �Routing Protocol (2)
Routing policies between four Autonomous Systems
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
BGP—The Exterior Gateway �Routing Protocol (3)
Propagation of BGP route advertisements
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011