0% found this document useful (0 votes)
4 views56 pages

Unit 3 Lect Notes

The document covers the concepts of switching and packet switching in computer networks, detailing the roles of the network layer, types of switching techniques, and their advantages and disadvantages. It explains circuit switching and packet switching, including their operations, error control, flow control, and congestion control. Additionally, it discusses virtual circuit switching, its identifiers, and comparisons between different switching methods.

Uploaded by

priya123regaraj
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)
4 views56 pages

Unit 3 Lect Notes

The document covers the concepts of switching and packet switching in computer networks, detailing the roles of the network layer, types of switching techniques, and their advantages and disadvantages. It explains circuit switching and packet switching, including their operations, error control, flow control, and congestion control. Additionally, it discusses virtual circuit switching, its identifiers, and comparisons between different switching methods.

Uploaded by

priya123regaraj
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

CS3591- COMPUTER NETWORKS

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.

ROUTING AND FORWARDING


Routing
 The network layer is responsible for routing the packet from its source to the destination.
 The network layer is responsible for finding the best one among these possible routes.
 The network layer needs to have some specific strategies for defining the best route.
 Routing is the concept of applying strategies and running routing protocols to create the
decision-making tables for each router.
 These tables are called as routing tables.
Forwarding
 Forwarding can be defined as the action applied by each router when a packet arrives at one
of its interfaces.
 The decision-making table, a router normally uses for applying this action is called the
forwarding table.
 When a router receives a packet from one of its attached networks, it needs to forward the
packet to another attached network.

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

devices linked to the switch.

 Switches are used to forward the packets based on MAC addresses.

 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.

 It is operated in full duplex mode.

 It does not broadcast the message as it works with limited bandwidth.

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.

Delay in a datagram network:

 The packet travels through two switches.


 There are three transmission times (3T),three propagation delays (slopes 3t of the lines), and
two waiting times (w1 + w2).
 We ignore the processing time in each switch.
Total delay = 3T + 3t + w1 + w2
Assessment questions to the lecture

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

Author(s) Title of the book Page numbers


Behrouz A. Data Communications and Networking with TCP/IP 206
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022
Unit Lecture
NETWORK LAYER 2
No 3 No
Topic Packet Switching and Internet Protocol
Bloom’sKnowledge
Learning Outcome (LO) At the end of this lecture, students will be able to
Level
LO1 Define virtual circuit switching and differentiate it from other packet K1
switching techniques such as datagram switching.
LO2 Explain the operation of virtual circuit switching in terms of packet K2
forwarding and routing within the network.
LO3 Compare virtual circuit switching with other switching techniques in K2
terms of scalability, resource utilization, and flexibility.
LO4 Define Internet Protocol (IP) and its role in the TCP/IP protocol suite, K1
including its position in the OSI model.
LO5 Discuss the concepts of packet forwarding, fragmentation, and K2
reassembly in IP networks.

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.

Virtual Circuit Identifier (VCI)


A virtual circuit identifier (VCI) that uniquely identifies the connection at this switch. A VCI, unlike a global
address, is a small number that has only switch scope; it is used by a frame between two switches. When a frame
arrives at a switch, it has a VCI; when it leaves, it has a different VCI.

Virtual Circuit Table


Every Virtual Circuit (VC) maintains a table called Virtual Circuit table. One entry in the VC table on a single
switch contains the following :
 An incoming interface on which packets for this VC arrive at the switch
 An outgoing interface in which packets for this VC leave the switch
 A outgoing VCI that will be used for outgoing packets

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

Delay in Virtual-Circuit Networks

 The packet is traveling through two switches (routers).


 There are three transmission times (3T ), three propagation times (3t), data transfer depicted by the sloping
lines, a setup delay (which includes transmission and propagation in two directions), and a teardown delay
(which includes transmission and propagation in one direction).
Total delay = 3T + 3t + Setup delay + Teardown delay

COMPARISON – CIRCUIT SWITCHING AND PACKET SWITCHING


CIRCUIT SWITCHING PACKET SWITCHING

Virtual Circuit Switching Datagram Switching

Connection oriented Connection oriented Connection less

Packets may be delivered out of order


Ensures in order delivery Ensures in order delivery

No reordering is required No reordering is required Reordering is required

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

Resources are allocated before Resources are allocated on demand


data transfer using 1st packet No resources are allocated

Stream oriented Packet oriented Packet oriented

Fixed bandwidth Dynamic Bandwidth Dynamic bandwidth

Reliable Reliable Unreliable

No overheads Less overheads Higher overheads

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

Example- Telephone systems Examples- X.25, Frame relay Example- Internet

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

 Type-of-Service: Specifies how an upper-layer protocol would like a current datagram


to be handled, and assigns datagrams various levels of importance.
 Total Length: Specifies the length, in bytes, of the entire IP packet, including the data
and header.
 Identification: Contains an integer that identifies the current datagram. This field is
used to help piece together datagram fragments.
 Flags: Consists of a 3-bit field of which the two low-order (least-significant) bits
control fragmentation. The low-order bit specifies whether the packet can be
fragmented. The middle bit specifies whether the packet is the last fragment in a series
of fragmented packets. The third or high-order bit is not used.
 Fragment Offset: Indicates the position of the fragment’s data relative to the
beginning of the data in the original datagram, which allows the destination IP process
to properly reconstruct the original datagram.
 Time-to-Live: Maintains a counter that gradually decrements down to zero, at which
point the datagram is discarded. This keeps packets from looping endlessly.
 Protocol: Indicates which upper-layer protocol receives incoming packets after IP
processing is complete.
 Header Checksum: Helps ensure IP header integrity.
 Source Address: Specifies the sending node.
 Destination Address: Specifies the receiving node.
Assessment questions to the lecture

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

Author(s) Title of the book Page numbers


Behrouz A. Data Communications and Networking with TCP/IP 207-210
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Unit
NETWORK LAYER Lecture No 1
No 3
Topic IPV4 and IP Addressing
Learning Outcome (LO) At the end of this lecture, students will be able Bloom’sKnowledge
to Level
LO1 Define IPv4 addressing and understand its significance in K1(Remembering)
computer networking.
LO2 Identify the structure of an IPv4 address, including the K1(Remembering)
distinction between network and host portions.
LO3 Explain the concept of subnetting and its importance in K2(Understanding)
optimizing IP address allocation.
LO4 Compare the relationship between subnet masks and address K2(Understanding)
classes in IPv4 addressing.
LO5 Explain the role of subnet masks and default gateways in IP K2(Understanding)
routing.

Lecture notes
IPV4:
 The identifier used in the IP layer of the TCP/IP protocol suite to identify the connection of

each device to the Internet is called the Internet address or IP address.


 Internet Protocol version 4 (IPv4) is the fourth version in the development of the Internet
Protocol (IP) and the first version of the protocol to be widely deployed.
 IPv4 is described in IETF publication in September 1981.
 The IP address is the address of the connection, not the host or the router. An IPv4 address is
a 32-bit address that uniquely and universally defines the connection .
 If the device is moved to another network, the IP address may be changed.
 IPv4 addresses are unique in the sense that each address defines one, and only one,
connection to the Internet.
 If a device has two connections to the Internet, via two networks, it has two IPv4 addresses.
 Pv4 addresses are universal in the sense that the addressing system must be accepted by any
host that wants to be connected to the Internet.
IPV4 ADDRESS SPACE
 IPv4 defines addresses has an address space.
 An address space is the total number of addresses used by the protocol.
 If a protocol uses b bits to define an address, the address space is 2 b because each bit can
have two different values (0 or 1).
 IPv4 uses 32-bit addresses, which means that the address space is 2 32 or 4,294,967,296
(more than four billion).
 4 billion devices could be connected to the Internet.
IPV4 ADDRESS NOTATION
There are three common notations to show an IPv4 address:
I. binary notation (base 2),
II. dotted-decimal notation (base 256), and
III. hexadecimal notation (base 16).

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.

HIERARCHY IN IPV4 ADDRESSING


 In any communication network that involves delivery, the addressing system is hierarchical.
 A 32-bit IPv4 address is also hierarchical, but divided only into two parts.

 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.

 A prefix can be fixed length or variable length.


 The network identifier in the IPv4 was first designed as a fixed-length prefix.
 This scheme is referred to as classful addressing.
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
 The new scheme, which is referred to as classless addressing, uses a variable- length
network prefix.

CATEGORIES OF IPV4 ADDRESSING


 There are two broad categories of IPv4 Addressing techniques.
 They are
 Classful Addressing
 Classless Addressing

CLASSFUL ADDRESSING
 An IPv4 address is 32-bit long(4 bytes).
 An IPv4 address is divided into sub-classes:

Classful Network Architecture


Class A
 In Class A, an IP address is assigned to those networks that contain a large number of hosts.
 The network ID is 8 bits long.
 The host ID is 24 bits long.
 In Class A, the first bit in higher order bits of the first octet is always set to 0 and the
remaining 7 bits determine the network ID.
 The 24 bits determine the host ID in any network.
 The total number of networks in Class A = 2 7 = 128 network address
 The total number of hosts in Class A = 2 24
- 2 = 16,777,214 host address
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Class B
 In Class B, an IP address is assigned to those networks that range from small- sized to large-
sized networks.
 The Network ID is 16 bits long.
 The Host ID is 16 bits long.
 In Class B, the higher order bits of the first octet is always set to 10, and the remaining14
bits determine the network ID.
 The other 16 bits determine the Host ID.
 The total number of networks in Class B = 2 14 = 16384 network address
 The total number of hosts in Class B = 2 16
- 2 = 65534 host address

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.

Address Depletion in Classful Addressing


 The reason that classful addressing has become obsolete is address depletion.
 Since the addresses were not distributed properly, the Internet was faced with the problem of
the addresses being rapidly used up.
 This results in no more addresses available for organizations and individuals that needed to
be connected to the Internet.
 To understand the problem, let us think about class A.
 This class can be assigned to only 128 organizations in the world, but each organization
needs to have a single network with 16,777,216 nodes .
 Since there may be only a few organizations that are this large, most of the addresses in this
class were wasted (unused).
 Class B addresses were designed for midsize organizations, but many of the addresses in
this class also remained unused.
 Class C addresses have a completely different flaw in design. The number of addresses that
can be used in each network (256) was so small that most companies were not comfortable
using a block in this address class.
 Class E addresses were almost never used, wasting the whole class.
Advantage of Classful Addressing
 Although classful addressing had several problems and became obsolete, it had one
advantage.
 Given an address, we can easily find the class of the address and, since the prefix length for
each class is fixed, we can find the prefix length immediately.
 In other words, the prefix length in classful addressing is inherent in the address; no extra
information is needed to extract the prefix and the suffix.

Assessment questions to the lecture


CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Bloom’s
Qn No Question Answer Knowledge
Level
1. What is the format of IP address? d K1
a) 34 bit
b) 64 bit
c) 16 bit
d) 32 bit
2. What is the usable size of network bits in Class B of IP C K1
address
a. 4
b. 8
c. 14
d. 16

3. The design of the Internet protocol suites adhere to the C K1


________Principle.
a. Data corruption
b. Connection Oriented
c. End to End Principle
d. Reliabilty

4. What is the use of subnetting? a K1


a. It divides one large network into several smaller ones
b. It divides network into network classes
c. It speeds up the speed of network
d. None of the above.

5. What is header of datagram in IPv4________ A K1


A. 20 to 60 bytes
B. 20 to 80 bytes
C. 20 to 40 bytes
D. 0 to 20 bytes

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

2. What is the subnetwork number of a host with an IP address C K1


of [Link]/21?
a. [Link]
b. [Link]
c. [Link]
d. [Link]

3. The network address of [Link]/19 provides how many B K1


subnets and hosts?
a. 7 subnets, 30 hosts each
b. 8subnets,8,190hosts each
c. 8subnets,2,046hosts each
d. 7subnets,2,046hosts each

4. You have a network that needs 29 subnets while maximizing D K2


the number of host addresses available on each subnet. How
many bits must you borrow from the host field to provide the
correct subnet mask?
a. 2
b. 3
c. 4
d. 5

5. If an Ethernet port on a router were assigned an IP address of A K2


[Link]/25, what would be the valid subnet address of
this host?
a. [Link]
b. [Link]
c. [Link]
d. [Link]

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

Author(s) Title of the book Page numbers


Behrouz A. Data Communications and Networking with TCP/IP 245-247
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Unit
NETWORK LAYER Lecture No 1
No 3
Topic IPV6
Learning Outcome (LO) At the end of this lecture, students will be able Bloom’sKnowledge
to Level
LO1 Define IPv6 and its significance as the next-generation Internet K1(Remembering)
Protocol.
LO2 Identify the key differences between IPv4 and IPv6 addressing, K1(Remembering)
including address format, address space, and header structure.
LO3 Describe the advantages of IPv6 over IPv4, including a K2(Understanding)
significantly larger address space, improved security features,
and simplified header format.
LO4 Explain the concept of address autoconfiguration in IPv6 and its K2(Understanding)
implications for network deployment and management.
LO5 Analyze the transition mechanisms used to facilitate the K4(Analyzing)
coexistence of IPv4 and IPv6 networks, such as dual-stack,
tunneling, and translation.

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

delay strategies and reservation of resources.

 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

required by new technologies or applications.


4. Support for resource allocation - In IPv6, the type-of-service field has been removed, but

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-

time audio and video.

Additional Features:
1. Need to accommodate scalable routing and addressing

2. Support for real-time services

3. Security support

4. Auto configuration -The ability of hosts to automatically configure themselves with such

information as their own IP address and domain name.

5. Enhanced routing functionality, including support for mobile hosts.

6. Transition from ipv4 to ipv6

ADDRESS SPACE ALLOCATION OF IPV6


 IPv6 provides a 128-bit address space to handle up to 3.4 × 10 38 nodes.

 IPv6 uses classless addressing, but classification is based on MSBs.

 The address space is subdivided in various ways based on the leading bits.

 The current assignment of prefixes is listed in Table

 A node may be assigned an “IPV4-compatible IPV6 address” by zero-extending a

32-bit .IPV4 address to 128 bits.


CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
 A node that is only capable of understanding IPv4 can be assigned an “IPv4- mapped

IPv6 address” by prefixing the 32-bit IPv4 address with 2 bytes of all 1s and then

zero-extending the result to 128 bits.

GLOBAL UNICAST
 Large chunks (87%) of address space are left unassigned for future use.

 IPv6 defines two types of local addresses for private networks.

Link local - enables a host to construct an address that need not be

globally unique.

Site local - allows valid local address for use in a isolated site with several

subnets.

 Reserved addresses start with prefix of eight 0's.

 Unspecified address is used when a host does not know its address

 Loopback address is used for testing purposes before connecting

 Compatible address is used when IPv6 hosts uses IPv4 network

 Mapped address is used when a IPv6 host communicates with a IPv4 host

 IPv6 defines any cast address, assigned to a set of interfaces.

 Packet with any cast address is delivered to only one of the nearest interface.

ADDRESS NOTATION OF IPV6


 Standard representation of IPv6 address is x : x : x : x : x : x : x : x

where x is a 16-bit hexadecimal address separated by colon (:).

For example,

47CD: 1234: 4422: ACO2: 0022: 1234: A456: 0124

 IPv6 address with contiguous 0 bytes can be written compactly.

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

of 1s and then zero-extending the result to 128 bits.

For example,

128. 96.33.81 → : : FFFF: [Link].This notation is called as CIDR notation or

slash notation.

ADDRESS AGGREGATION OF IPV6

IPv6 provides aggregation of routing information to reduce the burden on routers.Aggregation is

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.

 Prefix - All addresses in the same continent have a common prefix

 Registry ID ― identifies the continent

 Provider ID ― identifies the provider for Internet access, i.e., ISP.

 Subscriber ID ― specifies the subscriber identifier

 SubnetID ― contains subnet of the subscriber.

 InterfaceID ―contains link level or physical address.

PACKET FORMAT OF IPV6

 IPv6 base header is 40 bytes long.


CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM

 Version — specifies the IP version, i.e., 6.

 Traffic Class — defines priority of the packet with respect to traffic congestion. It is either

congestion-controlled or non-congestion controlled

 Flow Label — provides special handling for a particular flow of data. Router handles

different flows with the help of a flow table.

 Payload Len — gives length of the packet, excluding IPv6 header.

 Next Header — Options are specified as a header following IP header. NextHeader contains

a pointer to optional headers.

 Hop Limit — Gives the TTL value of a packet.

 Source Address / Destination Address — 16-byte addresses of source and destination

host.

Extension Headers

 Extension header provides greater functionality to IPv6.

 Base header may be followed by six 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.

 Source Routing — routing information provided by the source host.

 Fragmentation — In IPv6, only the source host can fragment. Source uses a path MTU

discovery technique to find smallest MTU on the path.

 Authentication — used to validate the sender and ensures data integrity.

 ESP (Encrypted Security Payload) — provides confidentiality against

Eavesdropping.

ADVANCED CAPABILITIES OF IPV6

 Auto Configuration — Auto or stateless configuration of IP address to hosts without the need

for a DHCP server, i.e., plug and play.

 Advanced Routing — Enhanced routing support for mobile hosts is provided.

 Additional Functions ― Enhanced routing functionality with support for mobile hosts.

 Security ― Encryption and authentication options provide confidentiality and integrity.

 Resource allocation ― Flow label enables the source to request special handling of real-time

audio and video packets.

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.

Each router thus need not process unwanted addition information.

Extensible ― Unassigned IPv6 addresses can accommodate needs of future technologies.

Dual-Stack Operation and Tunneling

In dual-stack, nodes run both IPv6 and IPv4, uses Version field to decide which stack

should process an arriving packet.IPv6 packet is encapsulated with an IPv4 packet as it


CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
travels through an IPv4 network. This is known as tunneling and packet contains tunnel

endpoint as its destination address.

Network Address Translation

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

Assessment questions to the lecture

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

2. In contrast to IPv4, IPv6 uses ____ times more bits to address C K1


a device on the Internet.
A. 2
B. 8
C. 4
D. 6
3. IPv6 supports which auto-configuration mode of its host devices? C K1
A. Stateful mode
B. Stateless mode
C. Both
Marks CO Bloom’s
Qn
Question Knowledge
No
Level
1 Compare IPV4 and IPV6 adreesing. NOV/DEC 2013 5 C214 K2
2 Explain in detail about the Global unicast addresses of 10 C214 K2
IPV6, with neat diagrams.
3 Explain IPV6 datagram format with suitable diagram 13 C214 K2
NOV/DEC 2019

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

physical address for a given logical address.

 The Address Resolution Protocol (ARP) is one of the auxiliary protocols defined in

the network layer.

 ARP stands for Address Resolution Protocol is the most important protocol of the Data

Link Layer.

 ARP is a network layer protocol used to convert an IP address (Network/Logical

address) into a MAC Address (Hardware /Physical address).

 The computer programs/applications use logical address (IP address) to send/receive

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 relies on broadcast support from physical networks.

 The Address Resolution Protocol is a request and response protocol.

ICMP IGMP IP address


IP

ARP

Network Layer Link Layer address

Position of ARP in TCP/IP protocol suite.

The types of ARP messages are:

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.

 It does this by broadcasting an ARP query onto the network.

 This query contains the target IP address. o Each host receives the query and checks

to see if it matches its IP address.

 If it does match, the host sends a response message that contains its link layer

address (MAC Address) back to the originator of the query.

 The originator adds the information contained in this response to its ARP table.

For example, To determine system B’s physical (MAC) address, system A

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

contains its own physical and IP address.

 This response packet is unicast which directly sends to the sender , by using its

physical address in the query packet.

Cache Memory: Caching


 The use of ARP will be very effective, when the ARP reply is cached. That is,

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.

ARP Packet Format

Hardware Type :( 16-bit field) defines the type of the link-layer protocol;

For example: Ethernet is given the type 1.

Protocol Type: (16-bit field) defines the network – layer protocol used with ARP.

For example: (0800)16 for IPV4 protocol.

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

request (or) a response.

Two packets type are defined: ARP request-1 and ARP response-2.

Sender Hardware address (variable-length field) defines the physical address of the

sender. For example, 6 bytes long for Ethernet.


CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Sender Protocol address : (variable-length field) defines the logical address of the sender

(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.

Reverse Address Resolution Protocol (RARP)

The process of mapping the given physical address to its corresponding logical address can

be carried out by the following protocols.

There are occasions in which a host knows its physical address, but needs to know its logical

address in the following figure. This may happen in two cases:

Case 1: A diskless station is just booted. The station can find its physical address by checking its

interface, but it does not know its IP address.

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

for a short time lease

They are:

1. Reverse Address Resolution Protocol (RARP)

2. Bootstrap Protocol(BOOTP), and

3. DHCP (Dynamic Configuration Protocol).

Reverse Address Resolution protocol (RARP) is a protocol, which is used by a physical

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

actively listening for RARP requests.

 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

respond with a RARP reply.

c. The requesting machine must be running a RARP client program; the responding

machine must be running a RARP server program.

RARP Packet Format & Encapsulation

 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

and 4 for RARP reply 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

the case of Ethernet, does not pass the boundaries of a network.

 This means that if an administrator has several networks or several subnets, it needs to

assign a RARP server for each network or subnet.

 This is the reason that RARP is almost obsolete.

 Two protocols, BOOTP and DHCP, are replacing RARP.


CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Assessment questions to the lecture

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.

4. The ARP protocol operates on which layer of the OSI 2 K1


model?
1. Physical Layer
2. Network Layer
3. Session Layer
4. Application

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

Author(s) Title of the book Page numbers


Behrouz A. Data Communications and Networking with TCP/IP 219-225
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022
CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
Unit
NETWORK LAYER Lecture No 1
No 3
Topic Internet Control Message Protocol (ICMP)
Learning Outcome (LO) At the end of this lecture, students will be able Bloom’sKnowledge
to Level
LO1 Explain the functioning of ICMP within the TCP/IP protocol K2(Understanding)
suite.
LO2 Identifying key fields and their significance in network K1(Remembering)
troubleshooting and management.
LO3 Identifying network congestion, and assessing network K1(Remembering)
reachability.
LO4 Discuss how ICMP can be utilized to optimize network K2(Understanding)
performance, including techniques for path MTU discovery and
efficient routing.
LO5 Discuss about how to develop critical thinking skills and the K2(Understanding)
ability to apply theoretical knowledge to practical network
challenges, fostering problem-solving abilities in a networking
context.

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.

 The rest of the header is specific for each message type.


 The data section in error messages carries information for finding the original packet that

had the error.

 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

to the lower layer in the following figure:

Error Reporting Messages

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

displayed in the figure.

 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,

parameter problems, and redirection in the following figure.

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.

o When a router or host discards a datagram due to congestion, it sends a source

quench message to the sender of the datagram.

This message has two purposes.

 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

source should slow down (quench) the sending process.

c. Time Exceeded :The time-exceeded message is generated in two cases:

 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

message arrive at the destination host within a certain time limit.

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

and sends a parameter-problem message back to the source.


CS3591- COMPUTER NETWORKS
II YEAR/ IV SEM
e. Redirection: When a router needs to send a packet destined for another network, it must

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.

 Updating the routing tables of hosts dynamically produces unacceptable traffic.

 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

network, to the wrong router.

 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 R2. The datagram goes to R1 instead.

 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.

 Host A's routing table can now be updated.

ICMP Query Messages

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:

 A query message is encapsulated in an IP packet, which in turn is encapsulated in a data link


layer frame.
 However, in this case, no bytes of the original IP are included in the message, as shown in
the above Figure .

Encapsulation of ICMP Query messages


a. Echo Request and Echo Reply: The echo-request and echo-reply messages are designed

for diagnostic purposes. The combination of echo-request and echo-reply messages

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

of just one) of echo-request and echo-reply messages, providing statistical information. We

can use the ping program to find if a host is alive and responding.

b. Timestamp Request and Timestamp Reply:

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

them. It can also be used to synchronize the clocks in two machines.

c. Address-Mask Request and Address-Mask Reply:

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-

mask-request message responds with an address-mask-reply message, providing the

necessary mask for the host. This can be applied to its full IP address to get its subnet

address.

d. Router Solicitation and Router Advertisement: The router-solicitation and router-

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

the network of which it is aware.

 Assessment questions to the lecture

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

packet, as shown in the following figure.

BOOTP client and server on the same network


BOOTP client and server on the same and different network

BOOTP Data Encapsulation

BOOTP Operation

There are two cases of BOOTP operation described below:

Case 1: Client and server on same network

1. When a BOOTP client is started, it has no IP address, so it broadcasts a message containing

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

that the client needs:

a. The client’s IP address, subnet mask, and default gateway address.

b. The IP address and host name of the BOOTP server.

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.

Case 2: Client and server on different networks

1. If the server exists on some distant network the BOOTP request is broadcast because the

client does not know the IP address of the server.

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

need for an intermediary.

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

in the request message defines the IP address of the relay agent.

8. BOOTP server sends a BOOTP reply message to the relay agent.

9. The relay agent, after receiving the reply, sends it to the BOOTP client.

Limitations of BOOTP

 BOOTP is not a dynamic configuration protocol.

 When a client requests its IP address, the BOOTP server consults a table that matches the

physical address of the client with its IP address.


 This implies that the binding between the physical address and the IP address of the client already

exists. The binding is predetermined i.e. static.

 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

is static and fixed in a table until changed by the administrator.

 BOOTP is a static configuration protocol.

DHCP

 The dynamic host configuration protocol is used to simplify the installation and maintenance

of networked computers.

 DHCP is derived from an earlier protocol called BOOTP.

 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

statically binds physical addresses to IP addresses.

 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

and assigns an IP address for a negotiable period of time.

 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

and disconnected from a network (as is a subscriber to a service

 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

stop using the IP address or renew the lease.

 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

displayed in the following figure.

DHCP Operation

DHCP client goes through the four step process:

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,

offering IP addressing information.

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

network parameters from a single server.


4. The DHCP server approves the lease with a DHCP Acknowledgement (DHCP Ack) packet. The

packet includes the lease duration and other configuration information.

Drawbacks of manual configuration:

1. A lot of work to configure all the hosts in a large network

2. Configuration process is error-prune

 It is necessary to ensure that every host gets the correct network number and that no two

hosts receive the same IP address.

 For these reasons, automated configuration methods are required.

 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

information for full system integration into the network.

 DHCP is based on a client/server model.

 DHCP clients send a request to a DHCP server to which the server responds with an IP

address

 DHCP server is responsible for providing configuration information to hosts.

 There is at least one DHCP server for an administrative domain.

 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

 A newly booted or attached host sends a DHCPDISCOVER message to a special IP address

([Link]., which is an IP broadcast address.

 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.

 Assessment questions to the lecture

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

Author(s) Title of the book Page numbers


Behrouz A. Data Communications and Networking with TCP/IP 270-272
Forouzan, Protocol Suite,
Sixth Edition TMH, 2022

You might also like