UNIT III
Network Layer
Contents
● Introduction : Functions of Network layer.
● Switching Techniques : Circuit switching,Message Switching, Packet
Switching.
● IP Protocol : Classes of IP (Network addressing),IPv4,IPv6,Network
Address Translation(NAT) ,Subnetting,CIDR.
● Network layer Protocols : ARP, RARP, ICMP, IGMP.
● Network Routing and Algorithms : Static Routing, Dynamic Routing,
Distance Vector Routing,Link State Routing, Path Vector.
● Routing Protocols : RIP, OSPF, BGP, MPLS.
● Routing in MANET : AODV, DSR, Mobile IP.
Introduction
Network layer is the third layer in the OSI model of computer networks.
It’s main function is to transfer network packets from the source to the destination.
It is involved both at the source host and the destination host.
At the source, it accepts a packet from the transport layer, encapsulates it in a
datagram and then deliver the packet to the data link layer so that it can further be
sent to the receiver.
At the destination, the datagram is decapsulated, the packet is extracted and
delivered to the corresponding transport layer.
Introduction
Main responsibility of Network layer is to carry the data packets from the source to
the destination without changing or using it.
If the packets are too large for delivery, they are fragmented i.e., broken down into
smaller packets.
It decides the route to be taken by the packets to travel from the source to the
destination among the multiple routes available in a network (also called as
routing).
The source and destination addresses are added to the data packets inside the
network layer.
Functions of Network layer
● Packetizing
● Routing and Forwarding
Packetizing
The process of encapsulating the data received from upper layers of the
network(also called as payload) in a network layer packet at the source and
decapsulating the payload from the network layer packet at the destination is
known as packetizing.
Packetizing
The source host adds a header that contains the source and destination address
and some other relevant information required by the network layer protocol to the
payload received from the upper layer protocol, and delivers the packet to the data
link layer.
Packetizing
The destination host receives the network layer packet from its data link layer,
decapsulates the packet, and delivers the payload to the corresponding upper
layer protocol.
The routers in the path are not allowed to change either the source or the
destination address.
The routers in the path are not allowed to decapsulate the packets they receive
unless they need to be fragmented.
Routing and Forwarding
In a network, there are a number of routes available from the source to the
destination.
The network layer specifies has some strategies which find out the best possible
route.
This process is referred to as routing.
There are a number of routing protocols which are used in this process and they
should be run to help the routers coordinate with each other and help in
establishing communication throughout the network.
Routing and Forwarding
Forwarding is simply defined as the action applied by each router when a packet
arrives at one of its interfaces.
When a router receives a packet from one of its attached networks, it needs to
forward the packet to another attached network (unicast routing) or to some
attached networks(in case of multicast routing).
Switching
Switching is process to forward packets coming in from one port to a port leading
towards the destination. When data comes on a port it is called ingress, and when
data leaves a port or goes out it is called egress. A communication system may
include number of switches and nodes.
circuit switching
When two nodes communicate with each other over a dedicated communication
path, it is called circuit switching.There 'is a need of pre-specified route from which
data will travels and no other data is permitted.In circuit switching, to transfer the
data, circuit must be established so that the data transfer can take place.
Circuits can be permanent or temporary. Applications which use circuit switching
may have to go through three phases:
● Establish a circuit
● Transfer the data
● Disconnect the circuit
Message Switching
In message switching, the whole message is treated as a data unit and is
switching / transferred in its entirety.
A switch working on message switching, first receives the whole message and
buffers it until there are resources available to transfer it to the next hop. If the
next hop is not having enough resource to accommodate large size message, the
message is stored and switch waits.
Message Switching
Packet Switching
The entire message is broken down into smaller chunks called packets. The
switching information is added in the header of each packet and transmitted
independently.
It is easier for intermediate networking devices to store small size packets and
they do not take much resources either on carrier path or in the internal memory of
switches.
Packet switching enhances line efficiency as packets from multiple applications
can be multiplexed over the carrier.
The internet uses packet switching technique.
Packet switching enables the user to differentiate data streams based on
priorities.
Packets are stored and forwarded according to their priority to provide quality of
service.
IP Protocol : Classes of IP (Network addressing)
Every host and router on the Internet has an IP address that can be used in the
Source address and Destination address fields of IP packets.
It is important to note that an IP address does not actually refer to a host. It really
refers to a network interface, so if a host is on two networks, it must have two IP
addresses.
multiple interfaces and thus multiple IP addresses.
IP Protocol : Classes of IP (Network addressing)
Each 32-bit address is comprised of a variable-length network portion in the top
bits and a host portion in the bottom bits. The network portion has the same value
for all hosts on a single network, such as an Ethernet LAN. This means that a
network corresponds to a contiguous block of IP address space. This block is
called a prefix.
IP addresses are written in dotted decimal notation. In this format, each of the 4
bytes is written in decimal, from 0 to 255. For example, the 32-bit hexadecimal
address 80D00297 is written as 128.208.2.151.
IP Protocol : Classes of IP (Network addressing)
The length of the prefix corresponds to a binary mask of 1s in the network portion.
When written out this way, it is called a subnet mask. It can be ANDed with the IP
address to extract only the network portion. For our example, the subnet mask is
255.255.255.0.
Fig. 5-48 shows a prefix and a subnet mask.
Classful and Special Addressing
IP addresses were divided into the five categories listed in Fig. 5-53. This
allocation has come to be called classful addressing.
Classful and Special Addressing
For most organizations, a class A network, with 16 million addresses, is too big,
and a class C network, with 256 addresses is too small. A class B network, with
65,536, is just right.

Unit 3 Network layer and protocols.pptx

  • 1.
  • 2.
    Contents ● Introduction :Functions of Network layer. ● Switching Techniques : Circuit switching,Message Switching, Packet Switching. ● IP Protocol : Classes of IP (Network addressing),IPv4,IPv6,Network Address Translation(NAT) ,Subnetting,CIDR. ● Network layer Protocols : ARP, RARP, ICMP, IGMP. ● Network Routing and Algorithms : Static Routing, Dynamic Routing, Distance Vector Routing,Link State Routing, Path Vector. ● Routing Protocols : RIP, OSPF, BGP, MPLS. ● Routing in MANET : AODV, DSR, Mobile IP.
  • 3.
    Introduction Network layer isthe third layer in the OSI model of computer networks. It’s main function is to transfer network packets from the source to the destination. It is involved both at the source host and the destination host. At the source, it accepts a packet from the transport layer, encapsulates it in a datagram and then deliver the packet to the data link layer so that it can further be sent to the receiver. At the destination, the datagram is decapsulated, the packet is extracted and delivered to the corresponding transport layer.
  • 4.
    Introduction Main responsibility ofNetwork layer is to carry the data packets from the source to the destination without changing or using it. If the packets are too large for delivery, they are fragmented i.e., broken down into smaller packets. It decides the route to be taken by the packets to travel from the source to the destination among the multiple routes available in a network (also called as routing). The source and destination addresses are added to the data packets inside the network layer.
  • 5.
    Functions of Networklayer ● Packetizing ● Routing and Forwarding
  • 6.
    Packetizing The process ofencapsulating the data received from upper layers of the network(also called as payload) in a network layer packet at the source and decapsulating the payload from the network layer packet at the destination is known as packetizing.
  • 7.
    Packetizing The source hostadds a header that contains the source and destination address and some other relevant information required by the network layer protocol to the payload received from the upper layer protocol, and delivers the packet to the data link layer.
  • 8.
    Packetizing The destination hostreceives the network layer packet from its data link layer, decapsulates the packet, and delivers the payload to the corresponding upper layer protocol. The routers in the path are not allowed to change either the source or the destination address. The routers in the path are not allowed to decapsulate the packets they receive unless they need to be fragmented.
  • 9.
    Routing and Forwarding Ina network, there are a number of routes available from the source to the destination. The network layer specifies has some strategies which find out the best possible route. This process is referred to as routing. There are a number of routing protocols which are used in this process and they should be run to help the routers coordinate with each other and help in establishing communication throughout the network.
  • 10.
    Routing and Forwarding Forwardingis simply defined as the action applied by each router when a packet arrives at one of its interfaces. When a router receives a packet from one of its attached networks, it needs to forward the packet to another attached network (unicast routing) or to some attached networks(in case of multicast routing).
  • 11.
    Switching Switching is processto forward packets coming in from one port to a port leading towards the destination. When data comes on a port it is called ingress, and when data leaves a port or goes out it is called egress. A communication system may include number of switches and nodes.
  • 13.
    circuit switching When twonodes communicate with each other over a dedicated communication path, it is called circuit switching.There 'is a need of pre-specified route from which data will travels and no other data is permitted.In circuit switching, to transfer the data, circuit must be established so that the data transfer can take place. Circuits can be permanent or temporary. Applications which use circuit switching may have to go through three phases: ● Establish a circuit ● Transfer the data ● Disconnect the circuit
  • 14.
    Message Switching In messageswitching, the whole message is treated as a data unit and is switching / transferred in its entirety. A switch working on message switching, first receives the whole message and buffers it until there are resources available to transfer it to the next hop. If the next hop is not having enough resource to accommodate large size message, the message is stored and switch waits.
  • 15.
  • 16.
    Packet Switching The entiremessage is broken down into smaller chunks called packets. The switching information is added in the header of each packet and transmitted independently. It is easier for intermediate networking devices to store small size packets and they do not take much resources either on carrier path or in the internal memory of switches. Packet switching enhances line efficiency as packets from multiple applications can be multiplexed over the carrier. The internet uses packet switching technique. Packet switching enables the user to differentiate data streams based on priorities. Packets are stored and forwarded according to their priority to provide quality of service.
  • 18.
    IP Protocol :Classes of IP (Network addressing) Every host and router on the Internet has an IP address that can be used in the Source address and Destination address fields of IP packets. It is important to note that an IP address does not actually refer to a host. It really refers to a network interface, so if a host is on two networks, it must have two IP addresses. multiple interfaces and thus multiple IP addresses.
  • 19.
    IP Protocol :Classes of IP (Network addressing) Each 32-bit address is comprised of a variable-length network portion in the top bits and a host portion in the bottom bits. The network portion has the same value for all hosts on a single network, such as an Ethernet LAN. This means that a network corresponds to a contiguous block of IP address space. This block is called a prefix. IP addresses are written in dotted decimal notation. In this format, each of the 4 bytes is written in decimal, from 0 to 255. For example, the 32-bit hexadecimal address 80D00297 is written as 128.208.2.151.
  • 20.
    IP Protocol :Classes of IP (Network addressing) The length of the prefix corresponds to a binary mask of 1s in the network portion. When written out this way, it is called a subnet mask. It can be ANDed with the IP address to extract only the network portion. For our example, the subnet mask is 255.255.255.0. Fig. 5-48 shows a prefix and a subnet mask.
  • 21.
    Classful and SpecialAddressing IP addresses were divided into the five categories listed in Fig. 5-53. This allocation has come to be called classful addressing.
  • 22.
    Classful and SpecialAddressing For most organizations, a class A network, with 16 million addresses, is too big, and a class C network, with 256 addresses is too small. A class B network, with 65,536, is just right.