This document discusses Internet addressing, ARP, and RARP. It begins by defining IP addresses and how they identify both the network and specific host. It then covers IPv4 addressing schemes including classful addressing using classes A-D, classless addressing using CIDR, and subnetting. The document also discusses address resolution using ARP for dynamic binding between IP and MAC addresses when they differ in size. IPv6 improvements such as larger addresses and direct mapping of IP to MAC are briefly mentioned.
3. Universal host identifiers
• Host - refer to an end system that attaches to the Internet.
• Internet divides all machines into two classes: routers and hosts.
• Each host on an internet is assigned a unique integer address called
its Internet Protocol address or IP address.
• An IP address is divided into two parts: a prefix of the address
identifies the network to which the host attaches and a suffix
identifies a specific host on the network.
4. 4
An IPv4 address is a 32-bit address that uniquely
and universally defines the connection of a device
(for example, a computer or a router) to the
Internet.
5. Categories of IP addressing
• Classful addressing
• Classless IP addressing
• CIDR – Classless Inter Domain Routing(pronounced as Cider)
5
10. Classful addressing
Binary notation
• Example : Find the class of the address 11000001 10000011 00011011 11111111
Solution : The first two bits of the given address are 11, and the third bit is 0. Therefore, it is a
class C address.
10
11. Classful addressing
Decimal notation
• Example : Find the class of the address 227.12.14.87
Solution : The first byte is 227, which is between 224 and 239, and thus, the given address is a
class D address.
11
12. Net ID and Host ID
• Net ID is the part of the IP address that identifies the network; and
• Host ID is the part of the IP address that identifies the host on the network.
12
14. Example…(1)
14
Change the following IPv4 addresses from binary
notation to dotted-decimal notation.
Solution
We replace each group of 8 bits with its equivalent
decimal number and add dots for separation.
15. Example ... (2)
15
Change the following IPv4 addresses from dotted-decimal
notation to binary notation.
Solution
We replace each decimal number with its binary equivalent
16. Example... (3)
16
Point out the error, if any, in the following IPv4 addresses.
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers or octets.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
17. Example... (4)
17
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
18. Subnetting and supernetting
To manage the address depletion temporarily
• Subnetting
• to divide a large block (Class A block) into smaller ones
• Large org. are unhappy this division
• Supernetting
• to combine several class C blocks into a larger block
• makes the routing of packets more difficult
18
19. Classless Addressing
• Scarcity of IPV4 addresses – (only 232 addresses)
• Short term solution - Classless Addressing (Uses IPV4 addresses )
• Long term solution – IPV6 Addresses (128 – bit address)
• Classless Addressing makes the allocation of IP Addresses
more efficient.
• It replaces the older classful addressing system which is
based on classes.
• It is also known as Classless Inter Domain Routing (CIDR).
19
20. Classless Addressing
• In CIDR , the whole address space is divided into variable length blocks.
• One restriction - number of addresses in a block i.e. block size needs
to be a power of 2. we can have a block of 20, 21, 22, . . . , 232
addresses
• Prefix length in classless addressing is variable
• Size of the network is inversely proportional to the length of the prefix.
small prefix a larger network; large prefix smaller network
• Prefix length: Slash Notation - prefix length, is added to the address,
separated by a slash
20
21. Classless Addressing – Slash Notation
Prefix length: Slash Notation - prefix length, is added to the address,
separated by a slash
Prefix tells the number of bits used for the identification of network.
Remaining bits are used for the identification of hosts in the network.
21
22. Example 1
A classless address is given as 167.199.170.82/27. Find the
three pieces of information.
1) The no. of addresses in the network is 232− 27 = 25 = 32
addresses.
2) Starting address can be found by keeping the first 27
bits and changing the rest of the bits to 0s.
3) Last address can be found by keeping the first 27 bits
and changing the rest of the bits to 1s.
22
23. Example 2
Given the CIDR representation 100.1.2.35/20. Find the range of
IP Addresses in the CIDR block
Solution:
Given CIDR IP Address may be represented as-
01100100.00000001.00000010.00100011 / 20
First IP Address = 01100100.00000001.00000000.00000000=100.1.0.0
Last IP Address =01100100.00000001.00001111.11111111=100.1.15.255
Range of IP Addresses = [ 100.1.0.0 , 100.1.15.255]
Network size = 2(32-20) = 212 = 4096 addresses
23
24. Use of address mask in CIDR
Another way to find the first and last addresses in the block is
to use the address mask.
The address mask is a 32-bit number in which the n leftmost
bits are set to 1s and the rest of the bits (32 − n) are set to 0s.
Address mask of a.b.c.d /27 is
11111111 11111111 11111111 11100000 in (255.255.255.224)d
Use bit-wise operations NOT, AND, and OR to extract the
information in a block as follows
No. of addresses in the block N = NOT (mask) + 1.
First address in the block = (Any address in the block) AND (mask).
Last address in the block = (Any address in the block) OR [(NOT
(mask)].
24
25. IPv4 subnet addressing
• Subnetting allows a single network prefix to be used for multiple
physical networks.
• Only hosts and routers at the site will know that there are multiple
physical networks and how to forward traffic among them.
• Routers and hosts in the rest of the Internet will assume there is a
single physical network at the site with hosts attached.
26. Problem
A classless address is given as 167.199.170.82/27. Find the three
pieces of information.
26
The mask is 27 leading 1’s ( i.e. ) 11111111 11111111 11111111 11100000
Given Address in binary 167.199.170.82/27 10100111 11000111 10101010 01010010
• First address: First = (address) AND (mask)
Address 10100111 11000111 10101010 01010010 AND
Mask 11111111 11111111 11111111 11100000
Answer : 10100111 11000111 10101010 01000000 167.199.170.64
• Last address: Last = (address) OR (NOT mask)
Address 10100111 11000111 10101010 01010010 OR
NOT mask 00000000 00000000 00000000 00011111
Answer : 10100111 11000111 10101010 01011111 167.199.170.85
• Number of addresses in the block: N = NOT (mask) + 1
Mask 11111111 11111111 11111111 11100000
NOT mask 00000000 00000000 00000000 00011111
Answer 0.0.0.31 + 1 = 32 addresses
27. Classless addressing
Note
In CIDR, a given address may belongs to several networks which is
based on prefix length.
Example
An address 230.8.24.56 belongs to class D in classful addressing.
But, in classless addressing , it may be belongs to several blocksks
as follows:
27
28. Classless Addressing
Network Address
• The first address in any network (block)
called network address, mainly used in
routing a packet to its destination
network.
• Each network is identified by its
network address.
• When a packet arrives at the router ,
the router needs to know to which
network the packet should be sent
• After the network address has been
found, the router consults its forwarding
table to find the corresponding interface
through which the packet sent out.
28
29. Classless Addressing- Subnetting
• Internet Corporation for Assigned Names and Numbers (ICANN) – global
authority allocate a large block of addresses to ISPs (or large organization )
• Subnetting - An organization (or an ISP) that is granted a range of addresses may
divide the range into several subranges and assign each subrange to a
subnetwork (or subnet). A subnetwork can be divided into several sub-
subnetworks and so on.
• Designing subnets
• 3 steps
1. No. of addresses in each subnetwork should be a power of 2.
2. Prefix length for each subnetwork should be found using the following
formula: Prefix length = 32 − log2(Block size)
3. Starting address in each subnetwork should be divisible by the
number of addresses in that subnetwork. This can be achieved if we
first assign addresses to larger subnetworks.
29
30. Subnetting Examples - 1
An organization is granted a block of addresses with the beginning address
14.24.74.0/24. The organization needs to have 3 subblocks of addresses to use in
its three subnets: one subblock of 10 addresses, one subblock of 60 addresses, and
one subblock of 120 addresses. Design the subblocks.
30
Step-1 : No. of addresses = 232– 24 = 256 addresses .
First address is 14.24.74.0/24;
Last address is 14.24.74.255/24.
Step- 2 : To find out prefix(Net ID), sort blocks from largest to smallest
1st largest subnet requires 120 addresses. We allocate 128 addresses. (power of 2)
Prefix(mask) = 32- log2128 = 32-log227 = 32-7 = 25
2nd largest subnet requires 60 addresses. We allocate 64 addresses.
Prefix(mask) = 32- log264 = 32-log226 = 32-6 = 26
3rd largest subnet requires 10 addresses. We allocate 16 addresses.
Prefix(mask) = 32- log216 = 32-log224 = 32-4 = 28
Step-3: First address Last Address Block size
Subnet I 14.24.74.0/25 14.24.74.127/25 128
Subnet II 14.24.74.128/26 14.24.74.191/26 64
Subnet III 14.24.74.192/28 14.24.74.207/28 16
Unused addrs 14.24.74.208 14.24.74.255 48
31. Classless addressing
Limited Broadcast vs Direct Broadcast Addresses
Limited-broadcast address
data reaches from source to all the host in
a same network
source will send message to all the host
connected to it
Since message covers all host so
destination Address would be
255.255.255.255
Same for all networks (subnets)
Msg - src addr -11.1.2.3
- dest. addr-255.255.255.255
.
31
Direct-broadcast address
When host in one network sends message
to all host in another network
Since network is different, directed
broadcast address is 30.255.255.255
Usually, the last address in each subnet is
used as direct-broadcast address
Msg - src addr -11.1.2.3
- dest. addr- 30.255.255.255
32. IPv6
• 128 bits / 16 octets
• Solves: insufficient capacity
• Dotted notation:
• Colon hexadecimal notation:
Advantage:
• compact and easier to enter .
• Allows zero compression
• Allows dotted decimal suffix
33. Address space assignment
• Two issues:
• How human manage addr
assignment
• How routers handle the
forwarding table
• Solution: multi-level hierarchy
/ multiple hierarchies
34. IPv4 to IPv6
• Two reasons for transition from IPv4 to IPv6
• Stateless IP/ICMP translation protocol (SIIT)
• Checksum problem
35. IPv6 unicast addresses and /64
• 3 parts:
• A globally-unique prefix – identify a site
• A subnet ID - used to distinguish among multiple physical networks at the
destination site
• An interface ID - used to identify a particular computer connected to
the subnet.
36. IPv6 interface identifier and MAC addresses
• Interface ID <- host identifier
• Lower 64 bits – identifies a specific network interface.
37. Special addresses
• 0.0.0.0 – temporary source address
• 255.255.255.255 – IPv4 limited broadcast address
• Host portion – all 1’s – directed broadcast address
• Subnet broadcast address – host portion – all 1’s
• Multicast addresses – begins with three 1’s
• Loopback address – 127.0.0.0/8
38. • Locally scoped – link local scope : 1111 1110 10
• Weaknesses in internet address
• If a host computer moves from one network to another, its internet address
must change – mobility
• Early binding – renumbering – absurd no.of bits(64)
• Forwarding – destination address – network address->router . Pblm:one IP
address is not sufficient, if a network is down.
39. Internet Address Assignment And Delegation
Of Authority
• Each network prefix - unique
• Internet Assigned Numbers Authority(IANA)
• Internet Corporation for Assigned Names and Numbers(ICANN)
42. Address resolution problem
• Consider two machines A and B that connect to the same physical
network. Each machine has an assigned IP address, IA and IB, and a
hardware (MAC) address, HA and HB.
• how does A map B’s Internet address to B’s hardware address,HB?
• The problem of mapping high-level addresses to physical addresses is
known as the address resolution problem.
• There are two basic types of hardware addresses: those that are
larger than the host portion of an IP address and those that are
smaller.
43. Resolution Through Direct Mapping
• IPv6 uses a technique known as direct mapping. The basic idea is
straightforward: use a computer’s hardware address as the host
portion of the computer’s Internet address.
44. Resolution in a direct mapped network
• If a computer’s IP address includes the computer’s hardware address,
address resolution is trivial.
• Direct mapping implies, the mapping can be performed without
reference to external data.
• Advantage: new computers can be added to a network without
changing existing assignments and without propagating new
information to existing computers.
• Direct mapping means selecting a function f that maps IP addresses
to physical addresses. Resolving an IP address IA means computing
HA = f(IA)
45. Address resolution through dynamic binding
• Direct mapping cannot be used with IPv4 if a hardware addresses is
larger than an IPv4 address.
• MAC address is 48 bits long and an IPv4 address is only 32 bits long.
• Designers of TCP/IP protocols found a creative solution to the address
resolution problem.
• The solution allows new hosts or routers to be added to a network
without recompiling code, and does not require maintenance of a
centralized database.
• Designers chose to use a low-level protocol that resolves addresses
dynamically - ARP
46. Idea behind dynamic resolution with ARP
• when it wants to resolve IP address IB, a host broadcasts an ARP request
packet that asks the host with IP address IB to respond with its hardware
address HB.
• All hosts, including B, receive the request, but only host B recognizes its IP
address and sends a reply that contains its hardware address.
• ARP is only used when a host needs to send an IP packet. Therefore, when
it receives a reply to its request, the host that made the request will use
the information to send an IP packet directly to B.
• The Address Resolution Protocol, ARP, allows a host to find the physical
address of a target host on the same physical network, given only the
target’s IP address
47. Illustrates the ARP protocol by showing host A
broadcasting a request for B, and B responding
48. ARP cache
• Cache : recently acquired IP-to-hardware address bindings.
• whenever a computer sends an ARP request and receives an ARP
reply, it saves the IP address and corresponding hardware address
information in its cache temporarily.
• When transmitting a packet, a computer always looks in its cache
before sending an ARP request.
• If it finds the desired binding in its ARP cache, the computer does not
need to broadcast a request.
49. ARP cache timeout
• soft state - a situation in which information can become stale without
warning
• A timer is set when information is added to the cache; when the
timer expires, the information is deleted.
• With a typical timeout being 20 minutes, when the timer expires, the
information must be removed.
• After removal there are two possibilities.
• If no further packets are sent to the destination, nothing occurs.
• If a packet must be sent to the destination and there is no binding present in
the cache, the computer follows the normal procedure of broadcasting an
ARP request and obtaining the binding.
• If the destination is still reachable, the new binding will be placed in the ARP
cache.
• If not, the sender will discover that the destination is not reachable.
50. Soft state in ARP has advantages and
disadvantages
• Advantage:
• a computer can determine when information in its ARP cache should be
revalidated independent of other computers.
• a sender does not need successful communication with the receiver or a third
party to determine that a binding has become invalid; if a target does not
respond to an ARP request, the sender will declare the target to be down.
• the scheme does not rely on network hardware to provide reliable transfer or
inform a computer whether another computer is online.
• Disadvantage:
• if the timer interval is N minutes, a sender may not detect that a receiver has
crashed until N minutes elapse.
51. ARP message format
• An ARP message does not have a fixed format header.
• The design allows ARP to map an arbitrary high-level protocol address
to an arbitrary network hardware address.
• In practice, ARP is only used to map 32-bit IPv4 addresses to 48-bit
Ethernet addresses.
• An ARP reply carries the IPv4 address and hardware address of the
original requester as well as the IPv4 address and hardware address
of the sender.
• In a request, the target hardware address is set to zero because it is
unknown.
52. The ARP message format when used to map
an IPv4 address to an Ethernet address.
54. ARP Refinement
• For reducing the amount of network traffic and automate recovery after a
hardware address changes.
1. To anticipate B’s need and avoid extra network traffic, ARP requires A to
include its IP-to-hardware address binding when sending B a request. B
extracts A’s binding from the request and saves the binding in its ARP
cache.
2. because requests are broadcast, all machines on the network receive a
copy of the request. The protocol specifies that each machine extract the
sender’s IP-to-hardware address binding from the request, and use the
information to update the binding in their cache.
3. The computer can notify others of a new address by broadcasting a
gratuitous ARP request.
55. • Summary :
The sender’s IP-to-hardware address binding is included in
every ARP broadcast; receivers use the information to update
their address binding information. The intended recipient uses
the information to create a new cache entry in anticipation of
a reply.
56. Relationship Of ARP To Other Protocols
• Because it uses direct mapping, IPv6 does not need ARP.
• ARP merely provides one possible mechanism to map an IP address to
a hardware address.
• Address binding is only needed to hide the underlying hardware
addresses.
• ARP is a low-level protocol that hides the underlying addressing used
by network hardware, permitting us to assign an arbitrary IP address
to every machine.
57. ARP implementation
• ARP software is divided into two parts:
• address resolution for outgoing packets: given the IP address of a computer
on the network, it finds the hardware address of the computer.
• handles incoming ARP packets.
58. ARP Encapsulation and Identification
• To identify the frame as carrying an ARP message, the sender assigns
a special value to the type field in the frame header.
• A single type value is used for all frames that carry an ARP message.
• For example, on an Ethernet, frames carrying ARP messages have a
type field of 0x0806, where the prefix 0x indicates a hexadecimal
value.
59. Automatic ARP Cache Revalidation
• Jitter -variance in packet transfer times.
• The key to avoiding jitter arises from early revalidation.
• The implementation associates two counters with each entry in the
ARP cache:
• traditional timer
• revalidation timer
60. Reverse Address Resolution (RARP)
• a system broadcasts a RARP request to obtain an IP address.
• The request contains the sender’s Ethernet address. A server on the
network receives the request, looks up the Ethernet address in a
database, extracts the corresponding IPv4 address from the database,
and sends a RARP reply with the information.
• RARP uses Ethernet type 0x8035
• RARP is no longer important for diskless devices, but has an
interesting use in cloud data centers.
61. ARP Caches In Layer 3 Switches
• An Ethernet switch is classified as a Layer 3 switch if the switch
understands IP packets and can examine IP headers when deciding
how to process a packet.
• The implementation arises from a desire to reduce ARP traffic.
• If each computer implements ARP cache timeouts, the computer will
periodically timeout cache entries and then broadcast an ARP
request.
• a switch can create its own cache of ARP information and can answer
requests.
62. Proxy ARP
• A technique known as proxy ARP to implement a form of security.
• The ARP Hack - the technique became known by the more formal
term proxy ARP.
• Proxy ARP relies on a computer that has two network connections
and runs special-purpose ARP software.
63. IPv6 Neighbor Discovery
• IPv6 uses the term neighbor to describe another computer on the
same network.
• IPv6’s Neighbor Discovery Protocol(NDP) replaces ARP and allows a
host to map between an IPv6 address and a hardware address.
• A key difference between ARP and NDP arises from the way each
handles the status of neighbors.
• ARP uses a late-binding approach with soft state. NDP uses early
binding and takes a proactive approach to state maintenance.