Unit 3 Lect Notes
Unit 3 Lect Notes
II YEAR/ IV SEM
Unit Lecture
NETWORK LAYER 1
No 3 No
Topic Switching, Packet Switching
Bloom’s Knowledge
Learning Outcome (LO) At the end of this lecture, students will be able to
Level
LO1 Define what a switch is and understand its role in computer networks. K1(Remembering)
LO2 Explain the advantages and disadvantages of each type of switching. K2(Understanding)
LO3 List the advantages of packet switching K1(Remembering)
LO4 Identify common security concerns in switched networks. K1(Remembering)
LO5 Differentiate between switching and other networking concepts like K2(Understanding)
routing and bridging.
Lecture notes
Network Layer Services:
The network layer in the TCP/IP protocol suite is responsible for the host-to- host delivery
of datagrams.
It provides services to the transport layer and receives services from the data- link layer.
The network layer translates the logical addresses into physical addresses
It determines the route from the source to the destination and also manages the traffic
problems such as switching, routing and controls the congestion of data packets.
The main role of the network layer is to move the packets from sending host to the receiving
host.
Services provided by network layer are
PACKETIZING
The first duty of the network layer is definitely packetizing.
This means encapsulating the payload (data received from upper layer) in a network-layer
packet at the source and decapsulating the payload from the network-layer packet at the
destination.
The network layer is responsible for delivery of packets from a sender to a receiver without
changing or using the contents.
ERROR CONTROL
The network layer in the Internet does not directly provide error control.
It adds a checksum field to the datagram to control any corruption in the
header, but not in the whole datagram.
This checksum prevents any changes or corruptions in the header of the datagram.
The Internet uses an auxiliary protocol called ICMP, that provides some kind of error
control if the datagram is discarded or has some unknown information in the header.
FLOW CONTROL
Flow control regulates the amount of data a source can send without overwhelming the
receiver.
The network layer in the Internet, however, 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.
Flow control is provided for most of the upper-layer protocols that use the services of the
network layer, so another level of flow control makes the network layer more complicated
and the whole system less efficient.
CONGESTION CONTROL
Another issue in a network-layer protocol is congestion control.
Congestion in the network layer is a situation in which too many datagrams are present in an
area of the Internet.
Congestion may occur if the number of datagrams sent by source computers is beyond the
capacity of the network or routers.
In this situation, some routers may drop some of the datagrams.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
SECURITY
Another issue related to communication at the network layer is security.
To provide security for a connectionless network layer, we need to have another virtual level
that changes the connectionless service to a connection- oriented service. This virtual layer
is called as called IPSec (IP Security).
Switching:
The technique of transferring the information from one computer network to another
network is known as switching.
Switching in a computer network is achieved by using switches.
A switch is a small hardware device which is used to join multiple computers together with
one local area network (LAN).
Switches are devices capable of creating temporary connections between two or more
A Switch is used to transfer the data only to the device that has been addressed. It
verifies the destination address to route the packet appropriately.
Advantages of Switching
Switch increases the bandwidth of the network.
It reduces the workload on individual PCs as it sends the information to only that
device which has been addressed.
It increases the overall performance of the network by reducing the traffic on the
network.
There will be less frame collision as switch creates the collision domain for each
connection.
Disadvantages of Switching:
A Switch is more expensive than network bridges.
A Switch cannot determine the network connectivity issues easily.
Proper designing and configuration of the switch are required to handle multicast packets.
Types of Switching Techniques
CIRCUIT SWITCHING
Circuit switching is a switching technique that establishes a dedicated path between sender
and receiver.
In the Circuit Switching Technique, once the connection is established then the dedicated
path will remain to exist until the connection is terminated.
Circuit switching in a network operates in a similar way as the telephone works.
A complete end-to-end path must exist before the communication takes place.
In case of circuit switching technique, when any user wants to send the data, voice, video, a
request signal is sent to the receiver then the receiver sends back the acknowledgment to
ensure the availability of the dedicated path. After receiving the acknowledgment, dedicated
path transfers the data.
Circuit switching is used in public telephone network. It is used for voice transmission.
Fixed data can be transferred at a time in circuit switching technology.
Phases in Circuit Switching
Communication through circuit switching has 3 phases:
1. Connection Setup / Establishment - In this phase, a dedicated circuit is established from
the source to the destination through a number of intermediate switching centres. The sender
and receiver transmits communication signals to request and acknowledge establishment of
circuits.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
2. Data transfer - Once the circuit has been established, data and voice are transferred from
the source to the destination. The dedicated connection remains as long as the end parties
communicate.
3. Connection teardown / Termination - When data transfer is complete, the connection is
relinquished. The disconnection is initiated by any one of the user. Disconnection involves removal
of all intermediate links from the sender to the receiver.
PACKET SWITCHING
The packet switching is a switching technique in which the message is sent in one go, but it
is divided into smaller pieces, and they are sent individually.
The message splits into smaller pieces known as packets and packets are given a unique
number to identify their order at the receiving end.
Every packet contains some information in its headers such as source address, destination
address and sequence number.
Packets will travel across the network, taking the shortest path as possible.
All the packets are reassembled at the receiving end in correct order.
If any packet is missing or corrupted, then the message will be sent to resend the message.
If the correct order of the packets is reached, then the acknowledgment message will be sent.
Advantages of Packet Switching:
Cost-effective: In packet switching technique, switching devices do not require massive
secondary storage to store the packets, so cost is minimized to some extent. Therefore, we
can say that the packet switching technique is a cost- effective technique.
Reliable: If any node is busy, then the packets can be rerouted. This ensures that the Packet
Switching technique provides reliable communication.
Efficient: Packet Switching is an efficient technique. It does not require any established
path prior to the transmission, and many users can use the same communication channel
simultaneously, hence makes use of available bandwidth very efficiently.
Disadvantages of Packet Switching:
Packet Switching technique cannot be implemented in those applications that require low
delay and high-quality services.
The protocols used in a packet switching technique are very complex and requires high
implementation cost.
If the network is overloaded or corrupted, then it requires retransmission of lost packets. It
can also lead to the loss of critical information if errors are nor recovered.
APPROACHES OF PACKET SWITCHING
There are two approaches to Packet Switching:
Datagram Packet switching
Virtual Circuit Switching
Datagram Packet switching
It is a packet switching technology in which packet is known as a datagram, is considered as
an independent entity.
Each packet contains the information about the destination and switch uses this information
to forward the packet to the correct destination.
The packets are reassembled at the receiving end in correct order.
In Datagram Packet Switching technique, the path is not fixed.
Intermediate nodes take the routing decisions to forward the packets.
Datagram Packet Switching is also known as connectionless switching.
There are no setup or teardown phases.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Each packet is treated the same by a switch regardless of its source or destination.
In this example, all four packets (or datagrams) belong to the same message, but may
travel different paths to reach their destination.
Routing Table
In this type of network, each switch (or packet switch) has a routing table which is based
on the destination address. The routing tables are dynamic and are updated periodically.
The destination addresses and the corresponding forwarding output ports are recorded in
the tables.
Bloom’s
Qn No Question Answer
Knowledge Level
Give questions pertaining to the content presented (MCQ, MSQ,
True/False, Fill in the blanks, matching)
1. A local telephone network is an example of a
________________ network. b K2(Understanding)
a)Packet Switched
b)Circuit Switched
c)Bit Switched
d)Line Switched
2. A switch in a datagram network uses a routing table that is based
on the ______ address
a)Source b K1(Remembering)
b)Destination
c)Local
d)None of the above
3. Circuit switching takes place at the ________ layer.
a) Data Line
b)Physical b K1(Remembering)
c)Network
d)Transport
4. Which is not true for packet switching?
A. Works at different line speeds D K1(Remembering)
B. Faster than circuit switching
C. Greater line efficiency
D. It is most popular method in internet
5. True or False: Packet switching req uires control and address bits False K1(Remembering)
to be added to each packet. This causes considerable overhead in
packet-switching.
Students have to prepare answers for the following questions at the end of the lecture
Marks CO Bloom’s
Qn
Question Knowledge
No
Level
1 Define Switch. 2 C214 K1
2 What is meant by packet switching. 2 C214 K1
3 List the advantages in the packet switching 2 C214 K1
4 Discuss how packet switching is better when compared to 10 C214 K2
circuit switching for computer-to- computer communication.
5 Explain the two different approaches of packet switching with 13 C214 K2
neat sketches.
Reference Book
Lecture notes
Virtual Circuit Switching
Virtual Circuit Switching is also known as connection-oriented switching.
In the case of Virtual circuit switching, a virtual connection is established before the messages are sent.
Call request and call accept packets are used to establish the connection between sender and receiver.
In this case, the path is fixed for the duration of a logical connection.
Example :
Source A sends a frame to Source B through Switch 1, Switch 2 and Switch 3.
Types of Virtual Circuits
There are two broad classes of Virtual Circuits. They are
1. PVC – Permanent Virtual Circuit
Network Administrator will configure the state
The virtual circuit is permanent (PVC)
2. SVC – Switched Virtual Circuit
A host can send messages into the network to cause the state to be established. This is referred as
signaling.
A host may set up and delete such a VC dynamically without the involvement of a network
administrator
A dedicated path exists for data A dedicated path exists for data transfer No dedicated path exists for data transfer
transfer
All the packets take the same All the packets take the same path All the packets may not take the same
path path
Implemented at physical layer Implemented at data link layer Implemented at network layer
Inefficient in terms of resource Provides better efficiency than circuit Provides better efficiency than message
utilization switched systems switched systems
INTERNET PROTOCOL:
Introduction:
The internet protocol (IP) is a protocol or set of rules for routing and addressing packets of data ,so that they
can travel across networks and arrive at the correct destination.
Data traversing the internet is divided into smaller pieces called packets. IP information is attached to each
packet and this information helps routers to send packets to the right place.
The main protocol, internet protocol version 4(IPV4) is responsible for packetizing, forwarding and delivery of a
packet at the network layer.
The Internet Protocol (IP) is a network-layer (Layer 3) protocol that contains addressing information
and some control information that enables packets to be routed.
IP is documented in RFC 791 and is the primary network-layer protocol in the Internet protocol
suite. Along with the Transmission Control Protocol (TCP), IP represents the heart of the Internet
protocols.
IP has two primary responsibilities: providing connectionless, best-effort delivery of datagrams
through an internetwork; and providing fragmentation and reassembly of datagrams to support data
links with different maximum-transmission unit (MTU) sizes.
IP Packet Format
Packets in the IPlayer are called datagrams. A datagram divided into two parts : Header and Data Header can be
from 20 to 60 bytes and contains information for routing and delivery of data.
IP packet fields Details:
Version: Indicates the version of IP currently used.
IP Header Length (IHL) :Indicates the datagram header length in 32-bit words.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Bloom’s
Qn No Question Answer Knowledge
Level
1. Circuit switching can involve the use of _______.
A. space division switches D K1
B. time domain switches
C. TDM bus
D. all of the above
2. What happens during the failure of a router in the virtual switching
circuit?
a. All the crashed packets get lost b K1
b. All the virtual circuits that passes through the router get
terminated
c. Congestion control becomes extremely difficult
d. Sequence of packets arrival gets disrupted
3. What are the interoffice lines used in the circuit switching usually
referred as? C K1
a. Loops
b. Nodes
c. Trunks
d. Switches
4. Which of these is a connection-oriented network protocol.?
[Link] b K1
b. IP
[Link]
d. All of the above.
5. TCP//IP is the Internet Protocol .State whether True or False. True K1
Marks CO Bloom’s
Qn
Question Knowledge
No
Level
1 Define Virtual circuit approach. 2 C214 K1
2 List the advantage of virtual circuit switching 2 C214 K1
3 Define IP 2 C214 K1
4 Discuss about circuit switching with neat sketches. 13 C214 K2
5 Write a note on addressing methods used in virtual circuit 8 C214 K3
approach.
Reference Book
Lecture notes
IPV4:
The identifier used in the IP layer of the TCP/IP protocol suite to identify the connection of
In binary notation, an IPv4 address is displayed as 32 bits. To make the address more readable, one
or more spaces are usually inserted between bytes (8 bits).
In dotted-decimal notation,IPv4 addresses are usually written in decimal form with a decimal point
(dot) separating the bytes. Each number in the dotted-decimal notation is between 0 and 255.
In hexadecimal notation, each hexadecimal digit is equivalent to four bits. This means that a 32-bit
address has 8 hexadecimal digits. This notation is often used in network programming.
The first part of the address, called the prefix, defines the network(Net ID); the second part
of the address, called the suffix, defines the node (Host ID).
The prefix length is n bits and the suffix length is (32-n) bits.
CLASSFUL ADDRESSING
An IPv4 address is 32-bit long(4 bytes).
An IPv4 address is divided into sub-classes:
Class C
In Class C, an IP address is assigned to only small-sized networks.
The Network ID is 24 bits long.
The host ID is 8 bits long.
In Class C, the higher order bits of the first octet is always set to 110, and the remaining 21
bits determine the network ID.
The 8 bits of the host ID determine the host in a network.
The total number of networks = 2 21
= 2097152 network address
The total number of hosts = 2 8 - 2 = 254 host address
Class D
In Class D, an IP address is reserved for multicast addresses.
It does not possess subnetting.
The higher order bits of the first octet is always set to 1110, and the remaining bits
determines the host ID in any network.
Class E
In Class E, an IP address is used for the future use or for the research and development
purposes.
It does not possess any subnetting.
The higher order bits of the first octet is always set to 1111, and the remaining bits
determines the host ID in any network.
Marks CO Bloom’s
Qn
Question Knowledge
No
Level
1 What is the purpose of subnet or subnetting? NOV/DEC 2 C214 K1
2012
2 Mention the drawbacks of IPV4 (OR) Why IPV6 2 C214 K1
preferred than IPV4? MAY/JUNE 2013
3 List the advantages of IPV6 over IPV4? (OR) Why is 2 C214 K1
IPV4 to IPV6 transition required? APR/MAY-2017
4 Discuss in detail about subnetting NOV/DEC 2011 13 C214 K2
5 Distinguish between IPV4 and IPV6 address. 10 C214 K2
Reference Book
Author(s) Title of the book Page numbers
Behrouz A. Data Communications and Networking with TCP/IP 210-247
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Unit
NETWORK LAYER Lecture No 1
No 3
Topic Subnetting
Learning Outcome (LO) At the end of this lecture, students will be able Bloom’sKnowledge
to Level
LO1 Define subnetting and its importance in IP address management K1(Remembering)
and network optimization.
LO2 Identify the components of an IPv4 address, including the K1(Remembering)
network portion and the host portion.
LO3 Explain the proficiency in subnetting IPv4 address spaces using K2(Understanding)
both fixed-length and variable-length subnet masks (VLSM).
LO4 Discuss the role of subnetting in IP routing and packet K2(Understanding)
forwarding.
LO5 Apply subnetting techniques to design and implement efficient K3(Applying)
network architectures that meet specific requirements.
Lecture notes
Subnetting and Supernetting
To alleviate address depletion, two strategies were proposed and implemented:
(i)Subnetting and (ii) Supernetting.
Subnetting
In subnetting, a class A or class B block is divided into several subnets.
Each subnet has a larger prefix length than the original network.
For example, if a network in class A is divided into four subnets, each subnet has a prefix of
nsub = 10.
At the same time, if all of the addresses in a network are not used, subnetting allows the
addresses to be divided among several organizations.
CLASSLESS ADDRESSING
In 1996, the Internet authorities announced a new architecture called classless addressing.
In classless addressing, variable-length blocks are used that belong to no classes.
We can have a block of 1 address, 2 addresses, 4 addresses, 128 addresses, and so on.4
In classless addressing, the whole address space is divided into variable length blocks.
The prefix in an address defines the block (network); the suffix defines the node (device).
0
Theoretically, we can have a block of 2 , 21, 222, 32 addresses.
The number of addresses in a block needs to be a power of 2. An organization can be
granted one block of addresses.
The prefix length in classless addressing is variable.
We can have a prefix length that ranges from 0 to 32.
The size of the network is inversely proportional to the length of the prefix.
A small prefix means a larger network; a large prefix means a smaller network.
The idea of classless addressing can be easily applied to classful addressing.
An address in class A can be thought of as a classless address in which the prefix length is 8.
An address in class B can be thought of as a classless address in which the prefix is 16, and
so on. In other words, classful addressing is a special case of classless addressing.
Notation used in Classless Addressing
The notation used in classless addressing is informally referred to as slash notation and
formally as classless interdomain routing or CIDR.
For example , [Link] /24 represents the IP address [Link] and, its subnet
mask [Link], which has 24 leading 1-bits.
Address Aggregation
One of the advantages of the CIDR strategy is address aggregation
(sometimes called address summarization or route summarization).
When blocks of addresses are combined to create a larger block, routing can be done based
on the prefix of the larger block.
ICANN assigns a large block of addresses to an ISP.
Each ISP in turn divides its assigned block into smaller sub blocks and grants the sub blocks
to its customers.
Special Addresses in IPv4
There are five special addresses that are used for special purposes: this-host address, limited-
broadcast address, loopback address, private addresses, and multicast addresses.
This-host Address
The only address in the block [Link]/32 is called the this-host address.
It is used whenever a host needs to send an IP datagram but it does not know its own address
to use as the source address.
Limited-broadcast Address
The only address in the block [Link]/32 is called the limited- broadcast address.
It is used whenever a router or a host needs to send a datagram to all devices in a network.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
The routers in the network, however, block the packet having this address as the
destination;the packet cannot travel outside the network.
Loopback Address
The block [Link]/8 is called the loopback address.
A packet with one of the addresses in this block as the destination address never leaves the
host; it will remain in the host.
Private Addresses
Four blocks are assigned as private addresses: [Link]/8, [Link]/12, [Link]/16, and
[Link]/16.
Multicast Addresses
The block [Link]/4 is reserved for multicast addresses.
Subnetting for a network should be done in such a way that it does not affect the network
Bits. In class C the first 3 octets are network bits so it remains as it is.
For Subnet 1:
The first bit which is chosen from the host id part is zero and the range will be from
193.1.2.00000000 to [Link] 11 111 expect for the first bit which is chosen zero for
subnet id part. Thus the range of subnet 1 :
[Link] to [Link]
Therefore, Sub net id of subnet1 is : [Link]
Direct broadcast id : [Link]
Total number of Host.
Assessment questions to the lecture
Bloom’s
Qn No Question Answer Knowledge
Level
1 What is the maximum number of IP addresses that c an be d K1
assigned to hosts on a local subnet that uses the
[Link] subnet mask?
a. 14
b. 15
c. 16
d. 30
Students have to aixprepare answers for the following questions at the end of the lecture
Marks CO Bloom’s
Qn
Question Knowledge
No
Level
1 Define subnetting NOV/DEC 2012 2 C214 K1
2 Write the advantages of subnetting. 2 C214 K3
3 Discuss in detail about subnetting 10 C214 K2
Reference Book
Lecture notes
IPV6
Internet Protocol Version 6
IPv6 was evolved to solve address space problem an d offers rich set of services.
Some hosts and routers will run IPv4 only, some will run IPv4 and IPv6 and some will run
IPv6 only.
DRAWBACKS OF IPV4
Despite subnetting and CIDR, address depletion is still a long-term problem.
Internet must accommodate real-time audio and video transmission that requires minimum
Internet must provide encryption and authentication of data for some applications.
FEATURES OF IPV6
1. Better header format - IPv6 uses a new header format in which options are separated from
the base header and inserted, when needed, between the base header and the data. This
simplifies and speeds up the routing process because most of the options do not need to be
checked by routers.
2. New options - IPv6 has new options to allow for additional functionalities.
3. Allowance for extension - IPv6 is designed to allow the extension of the protocol .If
two new fields, traffic class and flow label, have been added to enable the source to request
special handling of the packet. This mechanism can be used to support traffic such as real-
Additional Features:
1. Need to accommodate scalable routing and addressing
3. Security support
4. Auto configuration -The ability of hosts to automatically configure themselves with such
The address space is subdivided in various ways based on the leading bits.
IPv6 address” by prefixing the 32-bit IPv4 address with 2 bytes of all 1s and then
GLOBAL UNICAST
Large chunks (87%) of address space are left unassigned for future use.
globally unique.
Site local - allows valid local address for use in a isolated site with several
subnets.
Unspecified address is used when a host does not know its address
Mapped address is used when a IPv6 host communicates with a IPv4 host
Packet with any cast address is delivered to only one of the nearest interface.
For example,
For example,
47CD : 0000 : 0000 : 0000 : 0000 : 0000 : A456 : 0124 → 47CD : : A456 : 0124
IPv4 address is mapped to IPv6 address by prefixing the 32-bit IPv4 address with 2 bytes
For example,
slash notation.
done by assigning prefixes at continental level.For example, if all addresses in Europe have a
common prefix, then routers in other continents would need one routing table entry for all networks
in Europe.
Traffic Class — defines priority of the packet with respect to traffic congestion. It is either
Flow Label — provides special handling for a particular flow of data. Router handles
Next Header — Options are specified as a header following IP header. NextHeader contains
host.
Extension Headers
Each extension header contains a NextHeader field to identify the header following it.
Hop-by-Hop — source host passes information to all routers visited by the packet
Destination — source host information is passed to the destination only.
Fragmentation — In IPv6, only the source host can fragment. Source uses a path MTU
Eavesdropping.
Auto Configuration — Auto or stateless configuration of IP address to hosts without the need
Additional Functions ― Enhanced routing functionality with support for mobile hosts.
Resource allocation ― Flow label enables the source to request special handling of real-time
ADVANTAGES OF IPV6
Address space ― IPv6 uses 128-bit address whereas IPv4 uses 32-bit address. Hence
IPv6 has huge address space whereas IPv4 faces address shortage problem.
Header format ― Unlike IPv4, optional headers are separated from base header in IPv6.
In dual-stack, nodes run both IPv6 and IPv4, uses Version field to decide which stack
NAT enables hosts on a network to use Internet with local addresses.Addresses reserved
for internal use range from [Link] to [Link].Organization must have single
connection to the Internet through a router that runs the NAT software
Bloom’s
Qn No Question Answer Knowledge
Level
1. Which statement about IPV6 address is true? A K1
a. An IPV6 address is 128bits long,represented in
hexadecimal
b. An IPV6 address is 32bits long,represented in
hexadecimal
c. An IPV6 address is 128bits long,represented in decimal
d. An IPV6 address is 32bits long,represented in decimal
Reference Book
Author(s) Title of the book Page numbers
Behrouz A. Data Communications and Networking with TCP/IP 256-260
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Unit
NETWORK LAYER Lecture No 1
No 3
Topic ARP, RARP
Learning Outcome (LO) At the end of this lecture, students will be able Bloom’sKnowledge
to Level
LO1 Define Address Resolution Protocol (ARP) and its role in K1(Remembering)
mapping IP addresses to MAC addresses within a local network.
LO2 Explain the purpose and operation of ARP requests and ARP K2(Understanding)
replies in resolving IP addresses to MAC addresses.
LO3 Identify the components of an ARP packet, including the sender K1(Remembering)
and target MAC and IP addresses.
LO4 Define Reverse Address Resolution Protocol (RARP) and its role K1(Remembering)
in mapping MAC addresses to IP addresses.
LO5 Compare and contrast ARP and RARP in terms of their K2(Understanding)
functionality and use cases.
Lecture notes
Address Resolution Protocol:
The Address Resolution Protocol (ARP) is a dynamic mapping method used to find a
The Address Resolution Protocol (ARP) is one of the auxiliary protocols defined in
ARP stands for Address Resolution Protocol is the most important protocol of the Data
Link Layer.
messages, however the actual communication happens over the physical address
(MAC address).
To send a datagram over a network, we need both the logical and physical address.
IP addresses are made up of 32 bits whereas MAC addresses are made up of 48 bits.
ARP enables each host to build a table of IP address and corresponding physical
address.
ARP
1. ARP request
2. ARP reply
ARP Operation
In order to find the physical address of a node, the host(or) the router sends an ARP
query packet, which includes the physical and IP address of the sender and only the
IP address of the particular node, because the receiver’s physical address won’t be
known by this time. This query packet is broadcasted over the network.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
ARP maintains a cache table in which MAC addresses are mapped to IP addresses.
If a host wants to send an IP datagram to a host,it first checks for a mapping in the
cache table.
If no mapping is found, it needs to invoke the Address Resolution Protocol over the
network.
This query contains the target IP address. o Each host receives the query and checks
If it does match, the host sends a response message that contains its link layer
The originator adds the information contained in this response to its ARP table.
broadcasts an ARP request containing B’s IP address to all machines on its network.
Every host (or) the router process the received query packet, but only the intended
recipient recognize its IP address and sends back an ARP response packet, which
This response packet is unicast which directly sends to the sender , by using its
the system which receives an ARP reply stores the mapping in the cache
memory and keeps it for 20 to 30 minutes unless the space in the cache is
exhausted.
Because a system normally sends several packets to the same destination. Before
sending an ARP request, the system first checks its cache to see if it can find
the mapping.
Hardware Type :( 16-bit field) defines the type of the link-layer protocol;
Protocol Type: (16-bit field) defines the network – layer protocol used with ARP.
Hardware length: (8-bit field) defines the logical address length in bytes.
Protocol length : (8-bit field) defines the logical address length in bytes.
Operation (16-bit field) defines the type of the packet, which specifies whether this is
Two packets type are defined: ARP request-1 and ARP response-2.
Sender Hardware address (variable-length field) defines the physical address of the
(IP field). For example, this field is 8 bytes long for Ethernet.
Destination Protocol Address: (variable-length field) defines the logical address of the
destination. For example, this field is 4 bytes long for IPV4 protocol.
The process of mapping the given physical address to its corresponding logical address can
There are occasions in which a host knows its physical address, but needs to know its logical
Case 1: A diskless station is just booted. The station can find its physical address by checking its
Case 2: An organization does not have enough IP addresses to assign to each station; it
needs to assign IP addresses on demand. The station can send its physical address and ask
They are:
machine in a local area network (LAN) to request its IP address. It does this by sending the
device’s physical address to a specialized RARP server that is on the same LAN which is
For a machine, getting its physical address is very easy by reading its NIC, which is
unique locally. But to create an IP datagram, a host or a router needs its own IP address,
so it can be get from the physical address which we know already using the Reverse
ARP protocol.
a. RARP request is created and broadcast on the local network.
b. Another machine on the local network that knows all the IP addresses will
c. The requesting machine must be running a RARP client program; the responding
The format of the RARP packet is the same as the ARP packet format as displayed in
Figure 21.4, except that the Operation field. It’s value is 3 for RARP request message
An RARP packet is also encapsulated directly into a data link frame just like ARP
packet as displayed.
Limitations of RARP:
As broadcasting is done at the data link layer. The physical broadcast address, all 1’s in
This means that if an administrator has several networks or several subnets, it needs to
Bloom’s
Qn No Question Answer Knowledge
Level
1. When a device receives an ARP request for a device SOURCE, K1
with a different IP address, it will use the __ ___ DROP
information to update its ARP table and then it will _
____ the packet.
2. ARP _ ___ are sent to a broadcast MAC address, and REQUESTS, K1
ARP replies are sent to a _ ____ MAC address. UNICAST
3. Which of the following describes the function of RARP? B K1
A. It is used to map a 32-bit IP address to a 48-bit
ethernet address.
B. It is used to map a 48-bit ethernet address to a 32-bit
IP address.
C. It is used to map a 32-bit ethernet address to a 48-bit
IP address.
D. It is used to map a 48-bit IP address to a 32-bit
ethernet address.
Marks CO Bloom’s
Qn
Question Knowledge
No
Level
1 Define ARP 2 C214 K1
2 What do you mean by RARP 2 C214 K1
3 Give a detailed note on ARP operation, packet format and 10 C214 K2
the situations when the ARP services are used.
NOV/DEC 2017
4 Show the ARP packet format. APR/MAY2018 8 C214 K2
5 Explain about RARP with neat sketches. 13 C214 K2
Reference Book
Lecture notes
ICMP is a network-layer protocol and its messages are not passed directly to the data-link layer.
The messages are first encapsulated inside IP datagrams before going to the lower layer.
When an IP datagram encapsulates an ICMP message and the value of the protocol field in the IP
datagram is set to 1, to indicate that the IP payroll is an ICMP messages.
Two Types of ICMP Messages:
ICMP messages are divided into two broad categories: Error-reporting messages and Query
messages
The error-reporting messages report problems that a router or a host (destination) may encounter
when it processes an IP packet.
The query messages, which occur in pairs, help a host or a network manager get specific
information from a router or another host.
Message Format:
An ICMP message has an 8-byte header and a variable-size data section. Although the general
format of the header is different for each message type, the first 4 bytes are common to all.
As the following figure shows:
The first field, ICMP type, defines the type of the message.
The code field specifies the reason for the particular message type.
The last common field is the checksum field used for securing ICMP header.
In ICMP query messages, the data section carries extra information based on the type of the
query
ICMP Encapsulation:
ICMP itself is a network layer protocol. However it’s messages are not passed directly to
data link layer. Instead the messages are first encapsulated inside IP datagrams before going
One of the main responsibilities of ICMP is to report errors. Although technology has
produced increasingly reliable transmission media, errors still exist and must be handled. IP
is an unreliable protocol. This means that error checking and error control are not a concern
of IP. ICMP was designed, in part, to compensate for this shortcoming. However, ICMP
does not correct errors-it simply reports them. Error correction is left to the higher-level
protocols.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Error messages are typically sent when a datagram is discarded due to some error as
Error messages are always sent to the original source because the only information
available in the datagram about the route is the source and destination IP addresses.
Five types of errors are handled: destination unreachable, source quench, time exceeded,
a. Destination Unreachable : When a router cannot route a datagram or a host cannot deliver
a datagram, the datagram is discarded and the router or the host sends a destination-
unreachable message back to the source host that initiated the datagram. Note that
destination unreachable messages can be created by either a router or the destination host.
b. Source Quench: The IP protocol is a connectionless protocol. IP does not have a flow
control mechanism embedded in the protocol. The lack of flow control can create a major
problem in the operation of IP: congestion. The source host never knows if the routers or the
destination host has been overwhelmed with datagrams. The source host never knows if it is
producing datagrams faster than can be forwarded by routers or processed by the destination
host.
o The lack of flow control can create congestion in routers or the destination host. In
this case, the router or the host has no choice but to discard some of the datagrams.
o The source-quench message in ICMP was designed to add a kind of flow control to
the IP.
First, it informs the source that the datagram has been discarded.
Second, it warns the source that there is congestion somewhere in the path and that the
Case1: As routers use routing tables to find the next hop (next router) that must receive the
packet. If there are errors in one or more routing tables, a packet can travel in a loop or a
cycle, going from one router to the next or visiting a series of routers endlessly. Each
datagram contains a field called time to live that controls this situation. When a datagram
visits a router, the value of this field is decremented by 1. When the time-to live value
reaches 0, after decrementing, the router discards the datagram. However, when the
datagram is discarded, a time-exceeded message must be sent by the router to the original
source.
Case2: A time-exceeded message is also generated when not all fragments that make up a
d. Parameter Problem: Any ambiguity in the header part of a datagram can create serious
problems as the datagram travels through the Internet. If a router or the destination host
discovers an ambiguous or missing value in any field of the datagram, it discards the datagram
know the IP address of the next appropriate router. The same is true if the sender is a host. Both
routers and hosts, then, must have a routing table to find the address of the router or the next
router. Routers take part in the routing update process, and are supposed to be updated
constantly. Routing is dynamic. However, for efficiency, hosts do not take part in the routing
update process because there are many more hosts in an internet than routers.
The hosts usually use static routing. When a host comes up, its routing table has a
limited number of entries. It usually knows the IP address of only one router, the
default router.
For this reason, the host may send a datagram, which is destined for another
In this case, the router that receives the datagram will forward the datagram to the
correct router.
However, to update the routing table of the host, it sends a redirection message to the
host.
This concept of redirection is shown in the following figure. Host A wants to send a
datagram to host B.
Router R2 is obviously the most efficient routing choice, but host A did not choose
Router R1, after consulting its table, finds that the packet should have gone to R2.
It sends the packet to R2 and, at the same time, sends a redirection message to host A.
In addition to error reporting, ICMP can diagnose some network problems. This is accomplished
through the query messages, a group of four different pairs of messages, as shown in the following
Figure
In this type of ICMP message, a node sends a ICMP request message that is answered in a specific
format as ICMP reply by the destination node, depicted in the following figure:
determines whether two systems (hosts or routers) can communicate with each other in the
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
following figure .It also confirms that the intermediate routers are receiving, processing, and
forwarding IP datagrams.
Today, most systems provide a version of the ping command that can create a series (instead
can use the ping program to find if a host is alive and responding.
Two machines (hosts or routers) can use the timestamp request and timestamp reply
messages to determine the round-trip time needed for an IP datagram to travel between
A host may know its IP address, but it may not know the corresponding mask. For example,
a host may know its IP address as [Link], but it may not know that the corresponding
mask is /24. To obtain its mask, a host sends an address-mask-request message to a router on
the LAN. If the host knows the address of the router, it sends the request directly to the
router. If it does not know, it broadcasts the message. The router receiving the address-
necessary mask for the host. This can be applied to its full IP address to get its subnet
address.
advertisement messages can help a host to check whether the neighboring routers are alive
and functioning. A host can broadcast (or multicast) a router-solicitation message. The
router or routers that receive the solicitation message broadcast their routing information
using the router-advertisement message. A router can also periodically send router-
advertisement messages even if no host has solicited. Note that when a router sends out an
advertisement, it announces not only its own presence but also the presence of all routers on
Bloom’s
Qn No Question Answer Knowledge
Level
1. Header size of the ICMP message is _________ a K1
a) 8-bytes
b) 8-bits
c) 16-bytes
d) 16-bits
2. When a router cannot route a datagram or host cannot deliver a K2
a datagram, the datagram is discarded and the router or the
host sends a ____________ message back to the source host
that initiated the datagram.
a) Destination unreachable
b) Source quench
c) Router error
d) Time exceeded
3. The source-quench message in ICMP was designed to add a b K1
kind of ____________ to the IP.
a) error control
b) flow control
c) router control
d) switch control
4. Internet Control Message Protocol (ICMP) provides feedback True K1
about issues related to the processing of IP packets under
certain condition? State Whether it is True or False.
5. An ICMP Destination Unreachable message can be used to False K1
notify the source that a destination or service is reachable?
Marks CO Bloom’s
S. No Question Knowledge
Level
1 Expand ICMP and write the [Link]/JUNE2016 2 C214 K2
2 Write a short note on ICMP. MAY/JUNE2016 8 C214 K2
3 When is ICMP redirect message used? APR/MAY2017 2 C214 K2
4 Explain in detail the ICMP message format and error 13 C214 K2
reporting in detail.
5 Define ICMP 2 C214 K1
Reference Book
Author(s) Title of the book Page numbers
Behrouz A. Data Communications and Networking with TCP/IP 269-270
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Unit
NETWORK LAYER Lecture No 1
No 3
Topic Dynamic Host Configuration Protocol(DHCP) and Bootstrap Protocol(BOOTP)
Learning Outcome (LO) At the end of this lecture, students will be able Bloom’sKnowledge
to Level
LO1 Demonstrate the purpose, principles, and operation of DHCP in K2(Understanding)
dynamic IP address allocation within a network environment.
LO2 Discuss about how DHCP integrates with other network services K2(Understanding)
and protocols, such as DNS (Domain Name System), NTP
(Network Time Protocol), and TFTP (Trivial File Transfer
Protocol)
LO3 Develop critical thinking skills and the ability to analyze network K3(Applying)
configurations, diagnose DHCP-related issues, and propose
effective solutions to optimize DHCP performance and
reliability.
LO4 Explain about how DHCP operates in IPv6 networks, including K2(Understanding)
the role of DHCPv6 and its interaction with IPv6 address
assignment methods such as stateless address auto configuration
(SLAAC).
LO5 Explain in detail about DHCP configuration, deployment, and K2(Understanding)
management, ensuring compliance with industry standards and
security requirements.
Lecture notes
The Bootstrap Protocol (BOOTP) is a client/server based protocol at application layer, designed to
provide physical address to logical address mapping. The administrator may put the client and the
server on the same network or on different networks, as shown in the following figure. BOOTP
messages are encapsulated in a UDP packet, and the UDP packet itself is encapsulated in an IP
BOOTP Operation
its MAC address onto the network. This message is called a “BOOTP request,” and it is
picked up by the BOOTP server, which replies to the client with the following information
c. The IP address of the server that has the boot image, which the client needs to load its
operating system.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
2. When the client receives this information from the BOOTP server, it configures and
initializes its TCP/IP protocol stack, and then connects to the server on which the boot
image is shared.
1. If the server exists on some distant network the BOOTP request is broadcast because the
2. The client simply uses all as 0’s the source address and all 1’s as the destination address.
3. But a broadcast IP datagram cannot pass through any router. To solve the problem, there is a
4. One of the hosts in local network (or a router that can be configured to operate at the
application layer) can be used as a relay . The host in this case is called a relay agent.
5. The relay agent knows the unicast address of a BOOTP server. When it receives this type of
packet, it encapsulates the message in a unicast datagram and sends the request to the
BOOTP server.
6. The packet, carrying a unicast destination address, is routed by any router and reaches the
BOOTP server.
7. The BOOTP server knows the message comes from a relay agent because one of the fields
9. The relay agent, after receiving the reply, sends it to the BOOTP client.
Limitations of BOOTP
When a client requests its IP address, the BOOTP server consults a table that matches the
However, what if a host moves from one physical network to another? What if a host wants a
temporary IP address?
BOOTP cannot handle these situations because the binding between the physical and IP addresses
DHCP
The dynamic host configuration protocol is used to simplify the installation and maintenance
of networked computers.
Ethernet addresses are configured into network by manufacturer and they are unique.
IP addresses must be unique on a given internetwork but also must reflect the structure of
the internetwork
Most host Operating Systems provide a way to manually configure the IP information for
the host
The Dynamic Host Configuration Protocol dynamic address allocation that can be manual or
automatic.
Static Address Allocation compatible with BOOTP, which means a host running the BOOTP
client can request a static address from a DHCP server. A DHCP server has a database that
Dynamic Address Allocation addresses. This second database makes DHCP dynamic. When a
DHCP client requests temporary IP address, the DHCP server goes to the pool of availa addresses
When a DHCP client sends a static database. If an entry with the requested physical address
exists in the static database, the permanent IP address of the client is returned.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
On the other hand, if the entry an IP address from the available entry to the dynamic database.
The dynamic aspect of DHCP is needed when a host moves from network to network is connected
DHCP provides temporary IP addresses for a limited time. the pool are temporary addresses.
The DHCP server issues a lease for a specific time. When the lease expires, the client must either
The server has the option to agree or disagree the client stops using the address.
DHCP Operation
DHCP provides an automated way to distribute and update IP addresses and other configuration
information on a network. A DHCP server provides this information to a DHCP client through the
exchange of a series of messages, known as the DHCP conversation or the DHCP transaction
DHCP Operation
1. A DHCP client sends a broadcast packet (DHCP Discover) to discover DHCP servers on the
LAN segment.
2. The DHCP servers receive the DHCP Discover packet and respond with DHCP Offer packets,
3. If the client receives the DHCP Offer packets from multiple DHCP servers, the first DHCP Offer
packet is accepted. The client responds by broadcasting a DHCP Request packet, requesting
It is necessary to ensure that every host gets the correct network number and that no two
The primary method uses a protocol known as the Dynamic Host Configuration Protocol
(DHCP).
The main goal of DHCP is to minimize the amount of manual configuration required for a
host.
If a new computer is connected to a network, DHCP can provide it with all the necessary
DHCP clients send a request to a DHCP server to which the server responds with an IP
address
The DHCP server can function just as a centralized repository for host configuration
information.
The DHCP server maintains a pool of available addresses that it hands out to hosts on
demand.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
This means it will be received by all hosts and routers on that network.
DHCP uses the concept of a relay agent. There is at least one relay agent on each network.
DHCP relay agent is configured with the IP address of the DHCP server.
When a relay agent receives a DHCPDISCOVER message, it unicasts it to the DHCP server
and awaits the response, which it will then send back to the requesting client.
Bloom’s
Qn No Question Answer Knowledge
Level
1. DHCP (dynamic host configuration protocol) provides a K1
__________ to the client.
a) IP address
b) MAC address
c) Url
d) None of the mentioned
2. DHCP is used for ________ c K1
a) IPv6
b) IPv4
c) Both IPv6 and IPv4
d) None of the mentioned
3. DHCP uses UDP port _________ for sending data to the b K1
server.
a) 66
b) 67
c) 68
d) 69
4. DHCP uses TCP True or False? False K1
5. When a DHCP client is started for the first time it issues a request True K1
message with the DHCPDISCOVER option using port 67.
Students have to prepare answers for the following questions at the end of the lecture
Marks CO Bloom’s
Qn
Question Knowledge
No
Level
1 What is DHCP? NOV/DEC 2019 2 C214 K1
2 Write a Short note on DHCP. MAY/JUNE 2016 8 C214 K2
3 Write the advantages and disadvantages of DHCP. 6 C214 K2
4 What is DHCP Scope? 2 C214 K1
5 How do DHCP client and servers on the same subnet 16 C214 K2
communicate? How is this different from DHCP client
and server communication on different subnet?
Reference Book