Unit 3 Material
Unit 3 Material
Unit 3 Material
Switching : Packet Switching – Internet protocol – IPV4 – IP Addressing – Sub netting – IPV6,
ARP, RARP, ICMP, DHCP
Packet Switching
Write short notes on packet switching.
Packet switching is a method for sending data whereby the data is divided in packets.
Each packet is given a header containing information of the destination.
Each packet is forwarded through the network to the destination using this information.
At the destination the data has to be reassembled from the received packages.
There are two common packet switching methods in use:
Datagram Approach: Connectionless Service
o Each packet is forwarded independently based on the destination address.
o Routing decisions are made dynamically, so each packet may follow a different route and
thus the packages may arrive out of order.
IP Fragmentation Example
IPV4 Address
Briefly explain about IPv4 addresses.
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.
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a host or
a router to the Internet. The IP address is the address of the connection, not the host or the router,
because if the device is moved to another network, the IP address may be changed.
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 2b because each bit can have two
different values (0 or 1).
IPv4 uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296 (more than
four billion).
If there were no restrictions, more than 4 billion devices could be connected to the Internet.
Notation
There are three common notations to show an IPv4 address: binary notation (base 2), dotted-decimal
notation (base 256), and 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 each octet (8
bits).
Each octet is often referred to as a byte.
To make the IPv4 address more compact and easier to read, it is usually written in decimal form with
a decimal point (dot) separating the bytes.
This format is referred to as dotted-decimal notation.
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, which is now obsolete, is referred to as classfull addressing.
The new scheme, which is referred to as classless addressing, uses a variable-length network prefix.
Classfull Addressing
An IPv4 address was designed with a fixed-length prefix, but to accommodate both small and large
networks, three fixed-length prefixes were designed instead of one (n = 8, n = 16, and n = 24).
The whole address space was divided into five classes (class A, B, C, D, and E), as shown in the
Figure.
This scheme is referred to as classfull addressing.
IP ADDRESSING
Subnetting
Subnetting is the technique of partitioning a large network into smaller networks.
Advantages of Subnetting
Minimizes the network traffic through decreasing the volume of broadcasts.
Increases addressing flexibility.
Increases the number of allowed hosts in local area network.
The network security can be readily employed between subnets rather than employing it in the whole
network.
Subnets are easy to maintain and manage.
Disadvantages of Subnetting
However, it is quite expensive.
It requires trained administrator to perform subnetting.
Supernetting
Supernetting is the method used for combining the smaller ranges of addresses into larger space.
It was devised to make the routing process more convenient.
Advantages of Supernetting
The size of the router memory table is minimized by summarizing several routing information entries
into a single entry.
It also increases the speed of routing table lookup.
Provision for the router to isolate the topology changes from the other routers.
It also reduces the network traffic.
Disadvantages of Supernetting
The combination of blocks should be made in power 2; alternatively, if the three blocks are required,
then there must be assigned four blocks.
The whole network should exist in the same class.
When merged, it lacks covering different areas.
Classless Addressing
Special Addresses
The 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 0.0.0.0/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 255.255.255.255/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.
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 127.0.0.0/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.
Any address in the block is used to test a piece of software in the machine.
For example, we can write a client and a server program in which one of the addresses in the block is
used as the server address. We can test the programs using the same host to see if they work before
running them on different computers.
Private Addresses
Four blocks are assigned as private addresses: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and
169.254.0.0/16.
Multicast Addresses
The block 224.0.0.0/4 is reserved for multicast addresses.
Address Notation
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 a 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 : 128.96.33.81
Address Aggregation
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.
Format for provider-based unicast address aggregation is:
Version — The 4-bit field defines the version number of the IP. i.e., 6.
TrafficClass — The 8-bit field is used to distinguish different payloads with different delivery
requirements. It replaces the type-of-service field in IPv4.
FlowLabel — The flow label is a 20-bit field that is designed to provide special handling for a
particular flow of data.
PayloadLen — It is 2-byte field defines the length of the IP datagram excluding the header.
NextHeader — It is an 8-bit field defining the type of the first extension header or the type of the
data that follows the base header in the datagram.
HopLimit — It serves the same purpose as TTL field in IPv4.
SourceAddress / DestinationAddress — 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.
ARP
ARP stands for Address Resolution Protocol which is one of the most important protocols of the
Network layer in the OSI model. ARP finds the physical address, also known as Media Access Control
(MAC) address, of a host from its known IP address Figure.
ARP Mapping
ARP Operation
Following steps are involved in logical to physical address mapping:
Cache Memory
Using ARP is inefficient if system A needs to broadcast an ARP request for each IP packet
it needs to send to system B. ARP can be useful if the ARP reply is cached (kept in cache memoryfor
a while) because a system normally sends several packets to the same destination. A system that
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. Before sending an ARP request, the system first checks its cache to
see if it can find the mapping.
ARP packet
The fields are as follows:
a. Hardware type. This is a 16-bit field defining the type of the network on which ARP is running.
Each LAN has been assigned an integer based on its type. For example, Ethernet is given type
Encapsulation
An ARP packet is encapsulated directly into a data link frame. For example, in Figure 21.5 an ARP
packet is encapsulated in an Ethernet frame. Note that the type field indicates that the data carried by
the frame are an ARP packet.
1. The sender knows the IP address of the target. We will see how the sender obtains thisshortly.
2. IP asks ARP to create an ARP request message, filling in the sender physical address, the
sender IP address, and the target IP address. The target physical address field is filled with 0s.
3. The message is passed to the data link layer where it is encapsulated in a frame by using the physical
address of the sender as the source address and the physical broadcast address as the destination
address.
4. Every host or router receives the frame. Because the frame contains a broadcast destination address,
all stations remove the message and pass it to ARP. All machines except the one targeted drop the
packet. The target machine recognizes its IP address.
5. The target machine replies with an ARP reply message that contains its physical address. The
message is unicast.
Case 1: The sender is a host and wants to send a packet to another host on the same network. In this
case, the logical address that must be mapped to a physical address is the destination IP address in the
datagram header.
Case 2: The sender is a host and wants to send a packet to another host on another network.
In this case, the host looks at its routing table and finds the IP address of the next hop (router) for this
destination. If it does not have a routing table, it looks for the IP address of the default router. The IP
address of the router becomes the logical address that must be mapped to a physical address.
Case 3: The sender is a router that has received a datagram destined for a host on another network. It
checks its routing table and finds the IP address of the next router. The IP address of the next router
becomes the logical address that must be mapped to a physical address.
Case 4: The sender is a router that has received a datagram destined for a host on the same network.
The destination IP address of the datagram becomes the logical address that must be mapped to a
physical address.
RARP
RARP Reverse Address Resolution Protocol (RARP) finds the logical address for a machine that
knows only its physical address. To create an IP datagram, a host or a router needs to know its own IP
address or addresses. The IP address of a machine is usually read from its configuration file stored on a disk
file. However, a diskless machine is usually booted from ROM, which has minimum booting information.
The ROM is installed by the manufacturer.
It cannot include the IP address because the IP addresses on a network are assigned by the network
administrator. The machine can get its physical address (by reading its NIC, for example), which is unique
locally. It can then use the physical address to get the logical address by using the RARP protocol.
RARP Operation
RARP operation is displayed in Figure.
a. 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. Figure RARP Operation
RARP Packet Format & Encapsulation
The format of the RARP packet is the same as the ARP packet format as displayed in Figure,
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
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.
Destination Unreachable―When a router cannot route a datagram, the datagram is discarded and
sends a destination unreachable message to source host.
This message uses different codes (0 to 15) to define the type of error message and the reason why a
datagram has not reached its final destination.
Destination-unreachable messages include four basic types: They are,
o Network Unreachable
o Host Unreachable
o Protocol Unreachable
o Port Unreachable
Network-Unreachable
It indicates that the router cannot find the destination network (does not exist or has failed) or
has no route to this network.
Host-Unreachable
It alerts the sending host that the destination host requested cannot be found.
Protocol-Unreachable
Echo Request & Reply ― The echo request (type 8) and the echo reply (type 0) pair of messages is
used by a host or a router to test the liveliness of another host or router.
Timestamp Request & Reply ― The timestamp request (type 13) and the timestamp reply (type 14)
pair of messages is used to find the round-trip time between two devices or to check whether the
clocks in two devices are synchronized.
Deprecated Messages
Three pairs of messages are declared obsolete by IETF:
Information Request and Reply
o The Information Request/Reply (type 15 and 16) pair was intended to support self-
configuring systems, to allow them to discover their IP network prefixes at boot time.
Address Mask Request & Reply
o If the host knows the address of the router; it sends the request directly to the router.
o If it does not know, it broadcasts the message.
o The router receiving the address mask request message responds with an address mask reply
message, providing the necessary mask for the host.
Router Advertisement & Solicitation
Static Address Allocation In this capacity DHCP acts as BOOTP does. It is backward
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 DHCP has a second database with a pool of available IP
addresses. This second database makes DHCP dynamic. When a DHCP client requests a
temporary IP address, the DHCP server goes to the pool of available (unused) IP
addresses and assigns an IP address for a negotiable period of time.
• When a DHCP client sends a DHCP request to a DHCP server, the server first checks its static
database. If an entry with the requested physical address exists in the static database, the
permanent IP address of the client is returned.
• On the other hand, if the entry does not exist in the static database, the server selects an IP
address from the available pool, assigns the address to the client, and adds the entry to the
dynamic database.
• The dynamic aspect of DHCP is needed when a host moves from network to network or
is connected and disconnected from a network (as is a subscriber to a s rvice provider).
• DHCP provides temporary IP addresses for a limited time. The addresses assigned fromthe
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 with the renewal. If the server disagrees, 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 Figure.
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.