0% found this document useful (0 votes)
77 views7 pages

Unit IV - Network Layer

The network layer is responsible for transferring data packets between hosts. It encapsulates packets from the transport layer and adds addressing information before passing them to the data link layer. At the destination, it decapsulates packets and passes the payload to the transport layer. Key functions include packetizing, routing, and forwarding packets through intermediate routers using addressing. While it provides these functions, the network layer lacks flow and congestion control capabilities. Internetworking requires accommodating heterogeneous networks through functions like routing and addressing.

Uploaded by

AAYUSH RATHOD
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views7 pages

Unit IV - Network Layer

The network layer is responsible for transferring data packets between hosts. It encapsulates packets from the transport layer and adds addressing information before passing them to the data link layer. At the destination, it decapsulates packets and passes the payload to the transport layer. Key functions include packetizing, routing, and forwarding packets through intermediate routers using addressing. While it provides these functions, the network layer lacks flow and congestion control capabilities. Internetworking requires accommodating heterogeneous networks through functions like routing and addressing.

Uploaded by

AAYUSH RATHOD
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Network layer services and functions

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.
Features :
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.
The services which are offered by the network layer protocol are as follows:
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.
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.
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 –


These are two other services offered by the network layer. 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.
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).
Some of the other services which are expected from the network layer are:
Error Control –
Although it can be implemented in the network layer, but it is usually not preferred because the data packet in a
network layer maybe fragmented at each router, which makes error checking inefficient in the network layer.
Flow Control –
It regulates the amount of data a source can send without overloading the receiver. If the source produces a data at a
very faster rate than the receiver can consume it, the receiver will be overloaded with data. To control the flow of
data, the receiver should send a feedback to the sender to inform the latter that it is overloaded with data.
There is a lack of flow control in the design of the network layer. It does not directly provide any flow control. The
datagrams are sent by the sender when they are ready, without any attention to the readiness of the receiver.
Congestion Control –
Congestion occurs when the number of datagrams sent by source is beyond the capacity of network or routers. This
is another issue in the network layer protocol. If congestion continues, sometimes a situation may arrive where the
system collapses and no datagrams are delivered. Although congestion control is indirectly implemented in network
layer, but still there is a lack of congestion control in the network layer.
Advantages of Network Layer Services :
Packetization service in network layer provides an ease of transportation of the data packets.
Packetization also eliminates single points of failure in data communication systems.
Routers present in the network layer reduce network traffic by creating collision and broadcast domains.
With the help of Forwarding, data packets are transferred from one place to another in the network.
Disadvantages of Network Layer Services :
There is a lack of flow control in the design of the network layer.
Congestion occurs sometimes due to the presence of too many datagrams in a network which are beyond the
capacity of network or the routers. Due to this, some routers may drop some of the datagrams and some important
piece of information maybe lost.
Although indirectly error control is present in network layer, but there is a lack of proper error control mechanisms
as due to presence of fragmented data packets, error control becomes difficult to implement.

Internet Protocol: Principles of Internetworking, requirements


The overall requirements for an internetworking facility are:
Provide a link between networks. At minimum, a physical and link control connection is needed.
Provide for the routing and delivery of data between processes on different networks.
Provide an accounting service that keeps track of the use of the various networks and routers and maintains status
information.
Provide the services just listed without requiring modifications to the networking architecture of constituent networks.
This means accommodating the following differences:
Different addressing schemes: e.g., naming (DNS), DHCP.
Different maximum packet size: e.g., segmentation, ATM cells.
Different network access mechanisms: e.g., Ethernet, FDDI, ATM.
Different timeouts: longer with multiple networks.
Different error recovery services: some networks will have it, others won’t.
Internetwork error recovery should be independent of individual networks.
Different status reporting: how and whether this information can be shared.
Different routing techniques: may depend on fault detection and congestion control techniques. Coordination is
needed.
Different user access control: authorization for use of the network.
Connection-oriented vs. connectionless
Some of the above mentioned issues are dealt with in the IWUs.
It may be desirable for an internetwork service not to depend on the characteristics of individual networks.
By fulfilling these requirements, two important problems in interconnecting networks can be addressed:
Heterogeneity of types of networks
Scale of internetwork: routing and addressing issues with large growth.

IPv4 packet, IPv4 addressing (classful and classless (CIDR))


Network Address and Mask

Network address – It identifies a network on internet. Using this, we can find range of addresses in the network and
total possible number of hosts in the network.

Mask – It is a 32-bit binary number that gives the network address in the address block when AND operation is
bitwise applied on the mask and any IP address of the block.

The default mask in different classes are :

Class A – 255.0.0.0
Class B – 255.255.0.0
Class C – 255.255.255.0

Example : Given IP address 132.6.17.85 and default class B mask, find the beginning address (network address).

Solution : The default mask is 255.255.0.0, which means that the only the first 2 bytes are preserved and the other 2
bytes are set to 0. Therefore, the network address is 132.6.0.0.
Subnetting: Dividing a large block of addresses into several contiguous sub-blocks and assigning these sub-blocks to
different smaller networks is called subnetting. It is a practice that is widely used when classless addressing is done.

Classless Addressing

To reduce the wastage of IP addresses in a block, we use sub-netting. What we do is that we use host id bits as net id
bits of a classful IP address. We give the IP address and define the number of bits for mask along with it (usually
followed by a ‘/’ symbol), like, 192.168.1.1/28. Here, subnet mask is found by putting the given number of bits out of
32 as 1, like, in the given address, we need to put 28 out of 32 bits as 1 and the rest as 0, and so, the subnet mask
would be 255.255.255.240.

Some values calculated in subnetting :


1. Number of subnets : 2(Given bits for mask – No. of bits in default mask)
2. Subnet address : AND result of subnet mask and the given IP address
3. Broadcast address : By putting the host bits as 1 and retaining the network bits as in the IP address
4. Number of hosts per subnet : 2(32 – Given bits for mask) – 2
5. First Host ID : Subnet address + 1 (adding one to the binary representation of the subnet address)
6. Last Host ID : Subnet address + Number of Hosts
Example : Given IP Address – 172.16.0.0/25, find the number of subnets and the number of hosts per subnet. Also, for
the first subnet block, find the subnet address, first host ID, last host ID and broadcast address.
Solution : This is a class B address. So, no. of subnets = 2(25-16) = 29 = 512.
No. of hosts per subnet = 2(32-25) – 2 = 27 – 2 = 128 – 2 = 126
For the first subnet block, we have subnet address = 0.0, first host id = 0.1, last host id = 0.126 and broadcast address
= 0.127

Classful Address
The first addressing system to be implemented as part of the Internet Protocol was Classful Addressing. In the year
1981, the Classful addressing network architecture was first used on the Internet. The Classful addressing system was
superseded by a Classless addressing scheme with the introduction of Classless Inter-Domain Routing (CIDR) in
1993.
The IP address comprises up of 32 bits and is split into four sections separated by dots: part 1, part 2, part 3, and
part 4.
The IP address is made up of four parts, each of which is eight bits long (1 byte).
Further, the 4 parts of the IP address is divided into parts: a network ID and a Host ID.
Types of Classful Address
Class A, Class B, Class C, Class D, and Class E are the five varieties of Classful addresses. In IPv4, this
classification is known as Classful addressing or IP address classes.
The first three classes, Class A, B, and C, are used for "public addressing", in which communication is always one-to-
one between source and destination. It implies that when data is transmitted from a source, it will only be sent to a
single network host.
The reserved categories include Class D and Class E, with Class D being utilized for multicast and Class E being
saved for future usage exclusively.
In IPv4, the Network ID is the first part of Class A, B, and C, while the Host ID is the remaining second portion.
The Host ID always indicates the number of hosts or nodes in a certain network, whereas the Network ID always
identifies the network in a specific place.
In Class A, B, and C, the address space is split into a certain number of IP address blocks. It also specifies the
maximum number of hosts in a network.
Network and Host part in Classful Addressing
The first octet or byte of an IP address is part of the network ID (short for Net-ID), while the next three octets or three
bytes are part of the host ID in Class A. (in short, host-ID).
The network ID takes up the first two octets or two bytes in Class B, whereas the host ID takes up the remaining two
octets or two bytes.
In Class C, the first three octets or bytes are dedicated to the network ID, while the last octet or byte is dedicated to the
host ID.
Classless Addressing
Classless Inter-Domain Routing (CIDR) is another name for classless addressing. This addressing type aids in the
more efficient allocation of IP addresses. This technique assigns a block of IP addresses based on specified conditions
when the user demands a specific amount of IP addresses. This block is known as a "CIDR block", and it contains the
necessary number of IP addresses.
When allocating a block, classless addressing is concerned with the following three rules.
Rule 1 − The CIDR block's IP addresses must all be contiguous.
Rule 2 − The block size must be a power of two to be attractive. Furthermore, the block's size is equal to the number
of IP addresses in the block.
Rule 3 − The block's first IP address must be divisible by the block size.
For example, assume the classless address is 192.168.1.35/27.
The network component has a bit count of 27, whereas the host portion has a bit count of 5. (32-27)
The binary representation of the address is: (00100011 . 11000000 . 10101000 . 00000001).
(11000000.10101000.00000001.00100000) is the first IP address (assigns 0 to all host bits), that is, 192.168.1.32
(11000000.10101000.00000001.00111111) is the most recent IP address (assigns 1 to all host bits), that is,
192.168.1.63
The IP address range is 192.168.1.32 to 192.168.1.63.
Difference Between Classful and Classless Addressing
Classful addressing is a technique of allocating IP addresses that divides them into five categories. Classless
addressing is a technique of allocating IP addresses that is intended to replace classful addressing in order to reduce IP
address depletion.
The utility of classful and classless addressing is another distinction. Addressing without a class is more practical and
helpful than addressing with a class.
The network ID and host ID change based on the classes in classful addressing. In classless addressing, however, there
is no distinction between network ID and host ID. As a result, another distinction between classful and classless
addressing may be made.

Routing in Packet Switching Networks: Characteristics, Routing strategies


Routing protocols: RIP, OSPF, BGP and EIGRP.
A Router is a process of selecting path along which the data can be transferred from source to the destination. Routing
is performed by a special device known as a router.
A Router works at the network layer in the OSI model and internet layer in TCP/IP model
A router is a networking device that forwards the packet based on the information available in the packet header and
forwarding table.
The routing algorithms are used for routing the packets. The routing algorithm is nothing but a software responsible
for deciding the optimal path through which packet can be transmitted.
The routing protocols use the metric to determine the best path for the packet delivery. The metric is the standard of
measurement such as hop count, bandwidth, delay, current load on the path, etc. used by the routing algorithm to
determine the optimal path to the destination.
The routing algorithm initializes and maintains the routing table for the process of path determination.
Switching: Forwarding and Filtering Traffic
Most protocols are foregone conclusions, so when building networks, many of the choices are not choices at all. It is
highly probable that a network will be a mixture of Ethernet and 802.11 nodes. These nodes will run the Internet
Protocol at Layer 3 of the Transmission Control Protocol/Internet Protocol (TCP/IP) networking model (see Figure 1-
1). The applications will be designed for TCP or the User Datagram Protocol (UDP).
There are many types of switching: packet, circuit, multilayer, virtual circuit, wide area network (WAN), local area
network (LAN). Circuiting and virtual circuit switching almost always refer to WAN or telephone technologies, and as
such, will not be part of our discussion. Packet switching usually concerns a router or perhaps a WAN switch.
Multilayer switching is a technique for improving the processing of IP packets, but most vendors have different ideas
as to the best approach. Often, LAN switches are deployed without any thought to how multilayer switching might
improve performance. In fact, other than routing between VLANs, administrators are rarely interested in how
advanced features might be used on the network. Since this book is about IP-based networking, switching will almost
always refer to Ethernet frames and the routing will be that of IP packets.
Routing information protocols (RIP)
RIP (Routing Information Protocol) is a forceful protocol type used in local area network and wide area network. RIP
(Routing Information Protocol) type is categorized interior gateway protocol within the use of distance vector
algorithm. Routing information protocols defined in 1988. It also has version 2 and nowadays both versions are in use.
Technically it is outdated by more sophisticated techniques such as (OSPF) and the OSI protocol IS-IS.
Open shortest path first (OSPF)
Open Shortest Path First (OSPF) is an active routing protocol used in internet protocol. Particularly it is a link state
routing protocol and includes into the group of interior gateway protocol. Open Shortest Path First (OSPF) operating
inside a distinct autonomous system. The version 2 of Open Shortest Path First (OSPF) defined in 1998 for IPv4 then
the OSPF version 3 in RFC 5340 in 2008. The Open Shortest Path First (OSPF) most widely used in the network of
big business companies.
Border Gateway Protocol (BGP)
Border Gateway Protocol (BGP) are the core routing protocol of the internet and responsible to maintain a table of
Internet protocol networks which authorize network reaching capability between AS. The Border Gateway Protocol
(BGP) expressed as path vector protocol. It doesn’t employ conventional IGP metrics but making routing judgment
based on path, network policies. It is created to replace the Exterior Gateway Protocol (EGP) routing protocol to
permit completely decentralized routing in order to permit the removal of the NSF Net which consent to internet to
turn into a truly decentralized system. The fourth version of Border Gateway Protocol (BGP)has been in use since
1994 and 4th version from 2006 .The 4 version RFC 4271 has many features such as it correct a lots of previous
errors, illuminating vagueness and brought t the RFC much nearer to industry practice.
Enhanced interior gateway routing protocol (EIGRP)
Enhanced Interior Gateway Routing Protocol (EIGRP) based on their original IGRP while it is a Cisco proprietary
routing protocol. It is a distance-vector routing protocol in advance within the optimization to lessen both the routing
unsteadiness incurred after topology alteration, plus the use of bandwidth and processing power in the router which
support enhanced interior gateway routing protocol will automatically reallocate route information to IGRP (Enhanced
Interior Gateway Routing Protocol) neighbors by exchanging the 32 bit EIGRP (Enhanced Interior Gateway Routing
Protocol) metric to the 24 bit IGRP metric. Generally optimization based on DUAL work from SRI which assured
loop free operation and offer a means for speedy junction.
Subnetting, super netting
Subnetting:
Subnetting is the procedure to divide the network into sub-networks or small networks.

Supernetting:
Supernetting is the procedure to combine the small networks into larger space. In subnetting, Network addresses’s
bits are increased. on the other hand, in supernetting, Host addresses’s bits are increased. Subnetting is implemented
via Variable-length subnet masking, While supernetting is implemented via Classless interdomain routing.

VLSM
VLSM stands for Variable Length Subnet Mask where the subnet design uses more than one mask in the same
network which means more than one mask is used for different subnets of a single class A, B, C or a network. It is
used to increase the usability of subnets as they can be of variable size. It is also defined as the process of subnetting
of a subnet.

Procedure of implementing VLSM –


In VLSM, subnets use block size based on requirement so subnetting is required multiple times. Suppose there is an
administrator that has four departments to manage. These are sales and purchase department with 120 computers,
development department with 50 computers, accounts department with 26 computers and management department
with 5 computers.

If the administrator has IP 192.168.1.0/24, department wise IPs can be allocated by following these steps:

For each segment select the block size that is greater than or equal to the actual requirement which is the sum of host
addresses, broadcast addresses and network addresses. Make a list of subnets possible:
The highest IP available has to be allocated to highest requirement it gets 192.168.1.0/25 which has 126 valid
addresses that can easily be available for 120 hosts. The subnet mask used is 255.255.255.128
The next segment requires an IP to handle 50 hosts. The IP subnet with network number 192.168.1.128/26 is the next
highest which can be assigned to 62 hosts thus fulfilling the requirement of development department. The subnet mask
used is 255.255.255.192

Similarly the next IP subnet 192.168.1.192/27 can fulfill the requirements of the accounts department as it has 30 valid
hosts IP which can be assigned to 26 computers. The mask used is 255.255.255.224
The last segment requires 5 valid hosts IP which can be fulfilled by the subnet 192.168.1.224/29 which has the mask
as 255.255.255.248 is chosen as per the requirement. The IP with the mask 255.255.255.240 could be chosen but it has
14 valid host IPs and the requirement is less in comparison so the one that is comparable with the requirement is
chosen.

NAT
To access the Internet, one public IP address is needed, but we can use a private IP address in our private network.
The idea of NAT is to allow multiple devices to access the Internet through a single public address. To achieve this,
the translation of a private IP address to a public IP address is required. Network Address Translation (NAT) is a
process in which one or more local IP address is translated into one or more Global IP address and vice versa in
order to provide Internet access to the local hosts. Also, it does the translation of port numbers i.e. masks the port
number of the host with another port number, in the packet that will be routed to the destination. It then makes the
corresponding entries of IP address and port number in the NAT table. NAT generally operates on a router or
firewall.
Network Address Translation (NAT) working –
Generally, the border router is configured for NAT i.e the router which has one interface in the local (inside)
network and one interface in the global (outside) network. When a packet traverse outside the local (inside)
network, then NAT converts that local (private) IP address to a global (public) IP address. When a packet enters the
local network, the global (public) IP address is converted to a local (private) IP address.
If NAT runs out of addresses, i.e., no address is left in the pool configured then the packets will be dropped and an
Internet Control Message Protocol (ICMP) host unreachable packet to the destination is sent.

Introduction to ICMP, ARP, RARP IPv6 (IPv6 Datagram format, comparison with IPv4, and transition from IPv4
toIPv6).
The ICMP stands for Internet Control Message Protocol. It is a network layer protocol. It is used for error handling in
the network layer, and it is primarily used on network devices such as routers. As different types of errors can exist in
the network layer, so ICMP can be used to report these errors and to debug those errors.
For example, some sender wants to send the message to some destination, but the router couldn't send the message to
the destination. In this case, the router sends the message to the sender that I could not send the message to that
destination.
The IP protocol does not have any error-reporting or error-correcting mechanism, so it uses a message to convey the
information. For example, if someone sends the message to the destination, the message is somehow stolen between
the sender and the destination. If no one reports the error, then the sender might think that the message has reached the
destination. If someone in-between reports the error, then the sender will resend the message very quickly.
ARP stands for Address Resolution Protocol, which is used to find the MAC address of the device from its known IP
address. This means, the source device already knows the IP address but not the MAC address of the destination
device. The MAC address of the device is required because you cannot communicate with a device in a local area
network (Ethernet) without knowing its MAC address. So, the Address Resolution Protocol helps to obtain the MAC
address of the destination device.
he purpose of ARP is to convert the 32-bit logical address (IPv4 address) to the 48-bit physical address (MAC
address). This protocol works between layer 2 and layer 3 of the OSI model. The MAC address resides at layer 2,
which is also known as the data link layer and IP address resides at layer 3, this layer is also known as the network
layer.
RARP stands for Reverse Address Resolution Protocol. If the host wants to know its IP address, then it broadcast
the RARP query packet that contains its physical address to the entire network. A RARP server on the network
recognizes the RARP packet and responds back with the host IP address. The protocol which is used to obtain the IP
address from a server is known as Reverse Address Resolution Protocol. The message format of the RARP protocol
is similar to the ARP protocol. Like ARP frame, RARP frame is sent from one machine to another encapsulated in the
data portion of a frame.
An IP stands for internet protocol. An IP address is assigned to each device connected to a network. Each device uses
an IP address for communication. It also behaves as an identifier as this address is used to identify the device on a
network. It defines the technical format of the packets. Mainly, both the networks, i.e., IP and TCP, are combined
together, so together, they are referred to as a TCP/IP
. It creates a virtual connection between the source and the destination.
We can also define an IP address as a numeric address assigned to each device on a network. An IP address is assigned
to each device so that the device on a network can be identified uniquely. To facilitate the routing of packets, TCP/IP
protocol uses a 32-bit logical address known as IPv4(Internet Protocol version 4).
IPv4 is a version 4 of IP. It is a current version and the most commonly used IP address. It is a 32-bit address written
in four numbers separated by 'dot', i.e., periods. This address is unique for each device.
Currently, the population of the world is 7.6 billion. Every user is having more than one device connected with the
internet, and private companies also rely on the internet. As we know that IPv4 produces 4 billion addresses, which are
not enough for each device connected to the internet on a planet. Although the various techniques were invented, such
as variable- length mask, network address translation, port address translation, classes, inter-domain translation, to
conserve the bandwidth of IP address and slow down the depletion of an IP address. In these techniques, public IP is
converted into a private IP due to which the user having public IP can also use the internet. But still, this was not so
efficient, so it gave rise to the development of the next generation of IP addresses, i.e., IPv6.
IPv4 produces 4 billion addresses, and the developers think that these addresses are enough, but they were wrong.
IPv6 is the next generation of IP addresses. The main difference between IPv4 and IPv6 is the address size of IP
addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal address. IPv6 provides a large address
space, and it contains a simple header as compared to IPv4.
It provides transition strategies that convert IPv4 into IPv6, and these strategies are as follows:
Dual stacking: It allows us to have both the versions, i.e., IPv4 and IPv6, on the same device.
Tunneling: In this approach, all the users have IPv6 communicates with an IPv4 network to reach IPv6.
Network Address Translation: The translation allows the communication between the hosts having a different
version of IP.
This hexadecimal address contains both numbers and alphabets. Due to the usage of both the numbers and alphabets,
IPv6 is capable of producing over 340 undecillion (3.4*1038) addresses.
IPv6 is a 128-bit hexadecimal address made up of 8 sets of 16 bits each, and these 8 sets are separated by a colon. In
IPv6, each hexadecimal character represents 4 bits. So, we need to convert 4 bits to a hexadecimal number at a time

You might also like