CN Unit-3 Notes
CN Unit-3 Notes
NETWORK LAYER
INTERNET ADDRESS
• IP address is an address having information about how to reach
a specific host, especially outside the LAN. An IP address is a
32-bit unique address having an address space of 232.
• Generally, there are two notations in which IP address is written,
dotted decimal notation and hexadecimal notation.
Hexadecimal Notation:
CLASSFUL ADDRESSING
Classful Addressing is a way of dividing the 32-bit IPv4 address into
five different classes. Each class is designed to serve different sizes
of networks from very large to very small or for special purposes.
IPv4 address is divided into two parts:
• Network ID
• Host ID
The Network ID identifies the overall network, and the Host ID
identifies the specific device (like a computer or printer) on that
network.
Note: IP addresses are globally managed by Internet Assigned
Numbers Authority (IANA) and regional Internet registries (IR).
CLASSES OF IP ADDRESSING
The 32-bit IP address is divided into five sub-classes. These are given
below:
• Class A
• Class B
• Class C
• Class D
• Class E
Class A:
IP address belonging to class A are assigned to the networks that
contain many hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
The first number in a Class A address ranges from 1 to 126. For
example, the IP address 10.0.0.1 would fall under Class A. These
addresses are suitable for networks that require a huge number of
connected devices.
Class B:
IP address belonging to class B are assigned to the networks that
ranges from medium-sized to large-sized networks.
• The network ID is 16 bits long.
• The host ID is 16 bits long.
Class C:
IP address 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 first number in a Class C address ranges from 192 to 223. For
example, 192.168.1.1 is a common Class C address used in home
routers.
Class D:
Class D addresses are not used for regular network
communication. Instead, they are reserved for a special use called
multicasting. In multicasting, data is sent from one source to
multiple destinations at the same time. These addresses are not
divided into network and host parts. Class D addresses start with the
numbers 224 to 239 in the first part.
They are used mostly for audio or video streaming, online gaming, or
other services that need to send the same data to many users.
Class E:
Class E addresses are reserved for experimental or research
purposes. These are not used in everyday networking and are kept
for testing new technologies. Just like Class D, Class E addresses are
also not divided into network and host parts. They start from 240 up
to 255. Because they are experimental, you will rarely see Class E
addresses used in practice.
1. Wastage of IP Addresses
• In classful addressing, many IP addresses go unused.
• For example, Class A provides millions of addresses per
network, but most organizations don’t need that many.
• This leads to wasting many IPs, especially in Class A and Class
B.
2. Fixed Size Blocks
• The classes (A, B, C) have fixed sizes of network and host
portions.
• You can’t customize the size of the network or number of hosts
based on your needs.
• A small company might get a Class B address, which is too big,
or a Class C address, which might be too small.
4. Uneven Distribution
• Most Class A and B addresses were given to early
organizations and big companies.
• Smaller networks were forced to use Class C, even if it wasn't
enough for their needs.
• This created an unfair and unbalanced allocation of IP
addresses.
6. No Flexibility or Scalability
• Classful addressing lacks flexibility to divide networks based
on actual requirements.
• As networks grew, this rigid structure couldn’t scale well,
which became a problem.
SUBNETTING
SUBNET ADDRESS
ROUTING
Routing is the process of finding the best path for data to travel from
one computer to another across a network. Just like how a delivery
person chooses the shortest or fastest route to deliver a package,
routers (special devices on the internet or in a network) decide which
path data should take to reach its destination. When you send a
message or open a website, your data is broken into small pieces
called packets. These packets are sent through various devices and
paths, and routing helps guide each packet correctly until it reaches
the right device or server. Routing ensures that data moves efficiently,
even if there are many different routes it could take.
TYPES/TECHNIQUES OF ROUTING
1. Static Routing
2. Dynamic Routing
1. Static Routing
Advantages:
Disadvantages:
2. Dynamic Routing
Disadvantages:
ROUTING TABLE
DHCP
This is the first message sent by a device (called the client) when it
connects to a network and is looking for a DHCP server. Since the
device doesn’t yet have an IP address, it sends out a broadcast
message to everyone on the network asking, “Is there any DHCP
server out there who can give me an IP address?” This message uses
a special IP address 0.0.0.0 as the source (because the device has
no IP yet) and 255.255.255.255 as the destination (which means
broadcast to all devices). The goal is to find any available DHCP
server in the network.
Once the server receives the DHCP Request from the client, it sends
back a DHCP Acknowledgement (ACK) message. This confirms that
the IP address and settings are now officially assigned to that client.
The server also stores the information (like client ID, IP address,
lease time) in its memory so that it doesn’t give that same IP to
anyone else until the lease ends or is released.
5. DHCP Negative Acknowledgment Message (NAK)
ROUTING ALGORITHMS
1. Efficiency: They help in finding the most efficient route for data
transmission, reducing latency and improving overall network
performance.
2. Resource Optimization: By minimizing the distance or cost,
these algorithms help in conserving network resources, such as
bandwidth and energy.
3. Scalability: Many shortest path algorithms can be adapted to
work with large networks, making them suitable for various
applications, from small local networks to large-scale internet
routing.
4. Flexibility: They can be modified to account for different
metrics (e.g., bandwidth, delay) depending on the specific
needs of the network.
• The working process begins with a router looks around and finds
out which other routers it is directly connected to. It also checks
how good or bad the connection is, like how long it takes or how
busy the path is. Then, the router puts all this information into a
small message called a Link State Packet (LSP). This packet is
sent (or flooded) to all other routers in the network so that
everyone has the same information.
• Once all routers have received LSPs from everyone else, they
store this data to build a full map of the network.
• With this complete map in hand, each router then uses a
special method called Dijkstra's algorithm, each router uses
that map to figure out the shortest and best path to send data
to any other router.
1. High Memory and CPU Usage: Storing the full network map
and calculating paths takes more resources.
2. Complex Implementation: The algorithm is harder to set up
and maintain compared to distance vector.
3. More Bandwidth Used Initially: Flooding LSPs uses more
bandwidth, especially in large networks.
This process is fast and happens behind the scenes every time you
use your network. It is especially useful in IPv4 networks and is a
core part of how devices talk to each other in a LAN. However, ARP
only works within the local network. If the destination IP is not on the
same network, your device sends the data to the default gateway
(usually a router), which then takes care of forwarding it further.
Overall, ARP helps ensure that devices can translate human-friendly
IP addresses into the hardware addresses that are used to deliver
data on a physical network.
RARP PROTOCOL
3. Simple Protocol:
Let us see that the difference between ARP and RARP that are as
follows:
ARP RARP
A protocol used to map an IP A protocol used to map a physical
address to a physical address address to an IP address
To obtain the MAC address of a To obtain the IP address of a network
network device when only its IP device when only its MAC address is
address is known. known.
ARP stands for Address Resolution Whereas RARP stands for Reverse
Protocol. Address Resolution Protocol.
In ARP, broadcast MAC address is While in RARP, broadcast IP address
used. is used.
While in RARP, RARP table is
In ARP, ARP table is managed or
managed or maintained by RARP
maintained by local host.
server.
In Address Resolution Protocol,
While in RARP, IP address is fetched.
Receiver's MAC address is fetched.
ARP is used in sender's side to map RARP is used in receiver's side to
the receiver's MAC address. map the sender's IP.
ICMP PROTOCOL
For example, if your computer sends data to a website and the router
can’t find the best path, ICMP may reply with a “Destination
Unreachable” message. Similarly, if a packet takes too long to travel,
ICMP sends a “Time Exceeded” message.
ICMP Messages:
2. Parameter Problem
4. Destination Unreachable
5. Redirection Message
Advantages of ICMP:
Disadvantages of ICMP:
1. ICMP is used for error reporting if two devices connect over the
internet and some error occurs, So, the router sends an ICMP
error message to the source informing about the error.
IGMP PROTOCOL
IGMP (Internet Group Management Protocol) is a communication
protocol used by computers and network devices to manage group
memberships for multicast communication. In simple terms, IGMP
helps devices join or leave a group that receives the same
information at the same time, like live video streams, online games,
or real-time data feeds. Instead of sending multiple copies of the
same data to each device individually, multicast allows one copy to
be sent to a group, and IGMP keeps track of which devices are part of
that group. Routers use IGMP to know which devices want to receive
multicast traffic and make sure it is delivered to the right group
members only. This makes data transmission more efficient,
especially when the same content needs to reach many devices at
once.
IGMP Messages:
1. Membership Query
2. Efficient Streaming:
3. Router Communication:
4. Network Efficiency:
1. Saves Bandwidth:
2. Improves Performance:
Ideal for live video, real-time updates, and online gaming where
multiple users need the same data at the same time.
2. Network Overhead:
ICMP IGMP
ICMP stands for Internet Control While IGMP stands for Internet
Message Protocol. Group Message Protocol.
Internet control message protocol is While internet group message
unicasting. protocol is multicasting.
ICMP can be operate between host to
While IGMP can be used between
host or host to router or router to
client to multicast router.
router.
It controls the unicast communication It controls the multicast
and used for reporting error. communication.
While IGMP is used in group
ICMP is used to test reachability to a
packet transmission like DTS
host or network.
service.
ICMP is primarily used for diagnostic IGMP is primarily used for
and error reporting purposes. multicasting purposes.
ICMP messages are typically sent in IGMP messages are sent by hosts
response to errors or diagnostic to multicast routers to join or
requests. leave multicast groups.
IPv6 PROTOCOL
The data is broken into small packets, and each packet includes the
source and destination IPv6 addresses. These packets travel across
the internet, hopping through different routers, until they reach their
destination. IPv6 uses 128-bit addresses, which are much longer
than IPv4’s, allowing trillions of unique combinations.
IPv6 Header
The IPv6 header is the first part of an IPv6 packet and contains all the
important instructions needed to deliver the data across the internet.
It includes information like where the data is coming from, where it’s
going, how important the packet is, and how it should be handled
along the way. The IPv6 header is always 40 bytes long and has a
fixed structure, which helps routers and devices process data more
efficiently compared to IPv4. Because of its simpler design and larger
address space, IPv6 is better suited for the growing internet of the
future.
Fields in the IPv6 Fixed Header:
1. Version (4 bits):
This field shows which version of IP is being used. For IPv6, the
value is always 6 (binary: 0110).
This is like a priority label for the packet. It helps routers decide
which packets should be sent first when the network is busy.
Data like audio or video (real-time content) often gets higher
priority. The source device sets this value, but routers along the
path can adjust it.
This field helps to group packets that are part of the same "flow"
as a video stream or voice call. It allows routers to handle them
in a special way (e.g., give them consistent quality). If the flow
label isn’t being used, the value is set to 0.
This shows how much actual data (not including the header) is
inside the packet. If the data is very large (more than 65,535
bytes), a special option called Jumbo Payload is used instead,
and this field is set to 0.
This tells what comes next after the main IPv6 header. It could
be an extension header (extra information) or the start of the
actual data, like a TCP or UDP segment.
Like TTL (Time to Live) in IPv4, this field shows how many routers
the packet can pass through. Each time it goes through a router,
the number decreases by 1. If it reaches zero, the packet is
dropped to prevent it from looping forever.
This is the IPv6 address of the device that is sending the packet.
IPv4 IPv6
IPv4 has a 32-bit address length IPv6 has a 128-bit address length
It Supports Manual and DHCP It supports Auto and renumbering
address configuration address configuration
Address representation of IPv4 is in Address representation of IPv6 is in
decimal. hexadecimal.
Fragmentation performed by Sender In IPv6 fragmentation is performed
and forwarding routers. only by the sender.
In IPv4 Packet flow identification is In IPv6 packet flow identification are
not available. Available.
In IPv6 multicast and anycast
It has a broadcast Message
message transmission scheme is
Transmission Scheme
available
In IPv6 Encryption and
In IPv4 Encryption and Authentication
Authentication are provided
facility not provided
IPv4 consists of 4 fields which are IPv6 consists of 8 fields, which are
separated by addresses dot (.) separated by a colon (:)
IPv4's IP addresses are divided into
IPv6 does not have any classes of
five different classes. Class A, Class
the IP address.
B, Class C, Class D, Class E.
Example of IPv6:
Example of IPv4: 66.94.29.13 2001:0000:3238:DFE1:0063:0000:0
000:FEFB
Benefits of IPv6 over IPv4
The recent Version of IP IPv6 has a greater advantage over IPv4. Here
are some of the mentioned benefits:
Advantages of Unicast
Disadvantages of Unicast
Advantages of Multicast
Disadvantages of Multicast
Unicast Multicast
It has one or more senders and
It has one sender and one receiver.
multiple receivers.
It sends data from one device to It sends data from one device to
single device. multiple devices.
It works on star, mesh, tree and
It works on Single Node Topology.
hybrid topology.
It does not scale well for streaming It does not scale well across large
media. networks.
Multiple unicasting utilizes more
It utilizes bandwidth efficiently.
bandwidth as compared.
Web surfing, file transfer is an Video Streaming, Online gaming is
example of a unicast. an example of a multicast.
It has one-to-one mapping. It has one-to-many mapping.
--------------------------------------Finish---------------------------------------