CN - Module 3
CN - Module 3
The network Layer is the third layer in the OSI model of computer networks. Its
main function is to transfer network packets from the source to the destination. It
involves both the source host and the destination host.
3. 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. Routers are used
on the network for forwarding a packet from the local network to the remote network.
So, the process of routing involves packet forwarding from an entry interface out to
an exit interface.
Following are the packet forwarding techniques based on the destination host:
• Next-Hop Method: By only maintaining the details of the next hop or next
router in the packet’s path, the next-hop approach reduces the size of the
routing table. The routing table maintained using this method does not have
the information regarding the whole route that the packet must take.
• Network-Specific Method: In this method, the entries are not made for all
of the destination hosts in the router’s network. Rather, the entry is made of
the destination networks that are connected to the router.
• Host-Specific Method: In this method, the routing table has the entries for
all of the destination hosts in the destination network. With the increase in
the size of the routing table, the efficiency of the routing table decreases. It
finds its application in the process of verification of route and security
purposes.
Network Congestion occurs when the traffic moving through a network exceeds its
highest capacity. Congestion control refers to the techniques used to control or
prevent congestion. Congestion control techniques can be broadly classified into two
categories:
1. Backpressure :
Backpressure is a technique in which a congested node stops receiving packets from
upstream node. This may cause the upstream node or nodes to become congested
and reject receiving data from above nodes. Backpressure is a node-to-node
congestion control technique that propagate in the opposite direction of data flow.
The backpressure technique can be applied only to virtual circuit where each node
has information of its above upstream node.
In above diagram the 3rd node is congested and stops receiving packets as a
result 2nd node may be get congested due to slowing down of the output data flow.
Similarly 1st node may get congested and inform the source to slow down.
3. Implicit Signaling :
In implicit signaling, there is no communication between the congested nodes and
the source. The source guesses that there is congestion in a network. For example
when sender sends several packets and there is no acknowledgment for a while, one
assumption is that there is a congestion.
4. Explicit Signaling :
In explicit signaling, if a node experiences congestion it can explicitly send a packet
to the source or destination to inform about congestion. The difference between
choke packet and explicit signaling is that the signal is included in the packets that
carry data rather than creating a different packet as in case of choke packet
technique.
Explicit signaling can occur in either forward or backward direction.
• Forward Signaling : In forward signaling, a signal is sent in the direction
of the congestion. The destination is warned about congestion. The
receiver in this case adopt policies to prevent further congestion.
• Backward Signaling : In backward signaling, a signal is sent in the
opposite direction of the congestion. The source is warned about
congestion and it needs to slow down.
IP ADDRESSING
An IP address is a unique address that is used to identify computers or nodes on the
internet. This address is just a string of numbers written in a certain format. It is
generally expressed in a set of numbers for example 192.155.12.1.
Types of IP Address
Classful Addressing
Class A
IP addresses belonging to class A are assigned to the networks that contain a large
number of hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
The first octet is used to determine network ID. The 24 bits of host ID are used to
determine the host in any network. The default subnet mask for Class A is 255.0.0.0.
Therefore, class A has a total of:
• 2^24 – 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 0.0.0.0 – 127.255.255.255.
Class B
IP address belonging to class B is assigned to networks that range from medium-sized
to large-sized networks.
• The network ID is 16 bits long.
• The host ID is 16 bits long.
The 16 bits of host ID are used to determine the host in any network. The default
subnet mask for class B is 255.255.0.0. Class B has a total of:
• 2^16 – 2 = 65534 host address
IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.
Class C
IP addresses belonging to class C are assigned to small-sized networks.
• The network ID is 24 bits long.
• The host ID is 8 bits long.
The 8 bits of host ID are used to determine the host in any network. The default subnet
mask for class C is 255.255.255.0. Class C has a total of:
• 2^8 – 2 = 254 host address
IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.
Class D
IP address belonging to class D is reserved for multi-casting. Class D does not possess
any subnet mask. IP addresses belonging to class D range from 224.0.0.0 –
239.255.255.255.
Class E
IP addresses belonging to class E are reserved for experimental and research purposes.
IP addresses of class E range from 240.0.0.0 – 255.255.255.255. This class doesn’t
have any subnet mask.
Rules for Assigning Host ID
Host IDs are used to identify a host within a network. The host ID is assigned based
on the following rules:
• Within any network, the host ID must be unique to that network.
• A host ID in which all bits are set to 0 cannot be assigned because this host
ID is used to represent the network ID of the IP address.
• Host ID in which all bits are set to 1 cannot be assigned because this host
ID is reserved as a broadcast address to send packets to all the hosts
present on that particular network.
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.
A subnet or subnetwork is a network inside a network. Subnets make networks more
efficient. Through subnetting, network traffic can travel a shorter distance without
passing through unnecessary routers to reach its destination.
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. A classless addressing
system or classless interdomain routing (CIDR or supernetting) is the way to combine
two or more class C networks to create a/23 or a /22 supernet. A classless addressing
system or classless interdomain routing (CIDR) is an improved IP addressing system.
In a classless addressing system the block of IP address is assigned dynamically based
on specific rules.
Some values calculated in Subnetting:
What is Supernetting?
Supernetting is the opposite of Subnetting. In subnetting, a single big network is
divided into multiple smaller subnetworks. In Supernetting, multiple networks are
combined into a bigger network termed a Supernetwork or Supernet.
Supernetting is the process of aggregating routes to multiple smaller networks. Thus
saving storage space in the routing table, simplifying routing decisions, and reducing
route advertisements. Supernetting has helped to address the increasing size of routing
tables as the Internet has expanded.
More specifically,
• When multiple networks are combined to form a bigger network, it is
termed super-netting
• Super netting is used in route aggregation to reduce the size of routing
tables and routing table updates
Conditions for Supernetting
• All the Networks should be contiguous.
• The block size of every network should be equal and must be in form of
2n.
• First Network id should be exactly divisible by whole size of supernet.
Suppose 4 small networks of class C:
Subnetting Supernetting
Dynamic NAT
In this type of NAT, many different unregistered IP address from a private network
can be translated into a single registered (Public) IP address.It is a type of many to
one mapping.
NAT is used when the number of users who want to access the Internet is fixed.
Port Address Translation (PAT)
This is also known as NAT overload.This helps many local (private) IP addresses to
be translated to a single registered IP address. Port numbers are used to distinguish
the traffic i.e., which traffic belongs to which IP address. This is most frequently used
as it is cost-effective as thousands of users can be connected to the Internet by using
only one real global (public) IP address.