Module 3
IPV4 ADDRESSES
Address Space
Hierarchy in Addressing
The prefix length is n bits and the suffix length is (32 − n) bits.
Prefix Length
Classful Addressing
4. Class D is not divided into prefix and suffix. It is used for multicast addresses.
5. All addresses that start with 1111 in binary belong to class E.
As in Class D, Class E is not divided into prefix and suffix and is used as reserve.
Address Depletion
Classful addressing has become obsolete is address depletion.
Subnetting and Supernetting
To alleviate address depletion, two strategies were proposed.
Advantage of Classful Addressing
Classless Addressing
Classless Address Variable Length Technique
Classless Address Variable Length Technique
Classless Address Variable Length Technique
Note: Classless addressing is a specific instance of classful addressing.
Prefix Length - Slash Notation
The address is inserted in this scenario, followed by a slash, and the prefix length
Prefix Length - Slash Notation
Extracting Information from an Address
Extracting Information from an Address
Extracting Information from an Address
Example
Address Mask
Address Mask
Example
N = NOT (mask) + 1= 0.0.0.31 + 1 = 32 addresses
First address: First = (address) AND (mask) = 167.199.170.82
Last address:. Last = (address) OR (NOT mask) = 167.199.170.255
Network Address
Network Address
Block Allocation
Block Allocation
first address = (prefix in decimal) × 232 − n = (prefix in decimal) × N.
Convert IP address to Decimal
18 | 14 | 12 | 0 |
3 | 2 | 1 | 0 |
2563 | 2562 | 2561 | 2560 |
16777216 | 65536 | 256 | 1 |
16777216*18 | 65536*14 | 256*12 | 1*0 |
301,989,888 | 917,504 | 3,072 | 0 |
302,910,464 | | | |
Subnetting
Designing Subnets
Total number of addresses granted to the organization is N,
The prefix length is n,
Then assigned number of addresses to each subnetwork is Nsub, and the prefix length for each subnetwork is nsub.
Designing Subnets
Note:This can be achieved if we first assign addresses to larger subnetworks.
Finding Information about Each Subnetwork
Example
Example:Solution
we assign addresses to subblocks, starting with the largest and ending with the smallest one.
Example:Solution
n1 = 32 −log2128 = 25
Example:Solution
2. The number of addresses in the second largest subblock, which requires 60 addresses, is not a power of 2 either.
The subnet mask for this subnet,
n2 = 32 − log264 = 26.
Example:Solution
3. The number of addresses in the smallest subblock, which requires 10 addresses, is not a power of 2 either.
n3 = 32 − log216 = 28
Example:Solution
Address Aggregation
Example
Note: This is similar to routing we can find in a postal network. All packages coming from outside a country are sent first to the capital and then distributed to the corresponding destination.
Example
Special Addresses
This-host Address
Limited-broadcast Address
Loopback Address
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
Multicast Addresses
Dynamic Host Configuration Protocol (DHCP)
Dynamic Host Configuration Protocol (DHCP)
Dynamic Host Configuration Protocol (DHCP)
DHCP Message Format
DHCP Message Format
DHCP Message Format
DHCP Message Format
DHCP Message Format
Hardware Address Length: Specifies how long hardware addresses are in this message. For Ethernet or other networks using IEEE 802 MAC addresses, the value is 6.
Hardware Count: Set to 0 by a client before transmitting a request and used by relay agents to control the forwarding of DHCP messages.
Transaction Identifier: A 32-bit identification field generated by the client, to allow it to match up the request with replies received from DHCP servers.
Time Elapsed: It is defined as the number of seconds elapsed since a client began an attempt to acquire or renew a lease. This may be used by a busy DHCP server to prioritize replies when multiple client requests are outstanding.
DHCP Message Format
The 64-byte option field has a dual purpose.
DHCP Message Format
Operation of DHCP
DHCP discover message
DHCP discover message
DHCP offers a message
DHCP request message
DHCP acknowledgment message
Two Well-Known Ports
Using FTP
Error Control
Transition States
Network Address Resolution (NAT)
Network Address Resolution (NAT)
For example,
Assume, small business with 20 computers the maximum number of computers that access the Internet simultaneously is only 4.
Most of the computers are either doing some task that does not need Internet access or communicating with each other.
Small business can use the TCP/IP protocol for both internal and universal communication.
The business can use 20 (or 25) addresses from the private block addresses for internal communication; five addresses for universal communication can be assigned by the ISP.
Network Address Resolution (NAT)
Address Translation
Translation Table
Using One IP Address
Using a Pool of IP Addresses
Using Both IP Addresses and Port Addresses