Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification (16 bits) –To identify fragments as pieces of the original (along with source and destination addresses, and “protocol” field)
Fragmentation Flags (3 bits) Flags (3 bits) –“More” bit –“Don’t fragment” bit –Unused Offset (13 bits) Offset (13 bits) –Offset in 8-byte units from the beginning of the payload of the original
Fragmentation Id = abcd Frag 1 Frag 2 Id = abcd, More = 1, Offset = 0 Id = abcd, More = 0, Offset = x
Fragmentation Each fragment becomes a packet on its own Each fragment becomes a packet on its own –Routed independently of others Reassembly timer at receiver Reassembly timer at receiver –If all fragments do not arrive by the reassembly time-out, original packet cannot be obtained –ICMP error generated IP: RFC 791 IP: RFC 791
Class B address: x.y To the Internet eth0 eth eth eth eth eth1 Routing table
Problem Too many entries Too many entries No way to aggregate No way to aggregate Can we “extend” the network-id somehow? Can we “extend” the network-id somehow?
Subnetting The bits in the hostid part are further divided: The bits in the hostid part are further divided: netidhostid subnetid hostid
Subnet masks To extract the netid and subnetid parts from the IP address To extract the netid and subnetid parts from the IP address String of 1-s with trailing 0-s in the hostid part String of 1-s with trailing 0-s in the hostid part Bit-wise AND
Class B address: x.y To the Internet eth0 eth *eth * eth1 Routing table
Router operation Subnet mask: Subnet mask: Router should store this Router should store this Apply it to the D.A. field of incoming packet Apply it to the D.A. field of incoming packet Compare with and Compare with and
Forwarding Compact routing table Compact routing table Example was with a router Example was with a router –Same considerations for a host with multiple interfaces
N/w C1 N/w C2N/w C50
N/w C1 N/w C2N/w C50 Without subnetting C1 C2 … C50 Core router C1 C2 … C50 Core router
Subnetting Imagine now that instead of 50 Class C addresses, the organizations shared a single Class B address with subnetting Imagine now that instead of 50 Class C addresses, the organizations shared a single Class B address with subnetting
With subnetting B Core router B B1 B2 … B50 Edge router
Subnetting: drawbacks The size of the routing tables in the core routers decreases The size of the routing tables in the core routers decreases But problem: a class B address is used up! But problem: a class B address is used up! With 50 Class C addresses: 50x254=12700 hosts With 50 Class C addresses: 50x254=12700 hosts With a Class B address: hosts! With a Class B address: hosts! –Many addresses likely to be unused Class B address space starting to get exhausted Class B address space starting to get exhausted
Earlier example again N/w C1 N/w C2N/w C50 C1 C2 … C50 Core router C1 C2 … C50 Core router
Aggregation again? What if the 50 Class C addresses are allocated “nicely”, so that they can be aggregated? What if the 50 Class C addresses are allocated “nicely”, so that they can be aggregated? Leads to the idea of supernetting Leads to the idea of supernetting
Supernetting Example Example –C1: –C2: rd octet: 3 rd octet: – – Aggregation: Aggregation: Single r.t. entry: Single r.t. entry: – * Mask to be used: 23 bits Mask to be used: 23 bits
Supernetting N/w C1 N/w C2N/w C50 Aggr C Core router Aggr C Core router
Supernetting Avoids routing table size explosion Avoids routing table size explosion Also avoids wasted (unused) IP addresses Also avoids wasted (unused) IP addresses A “best of both worlds” solution A “best of both worlds” solution Key: allocate Class C addresses appropriately, so that aggregation is possible Key: allocate Class C addresses appropriately, so that aggregation is possible
CIDR With classes A, B and C, the number of netid bits (i.e., “netmask length”) is implicitly fixed: 8, 16 and 24 With classes A, B and C, the number of netid bits (i.e., “netmask length”) is implicitly fixed: 8, 16 and 24 But with aggregation, variable-length netmasks are necessary But with aggregation, variable-length netmasks are necessary Classless Inter-Domain Routing Classless Inter-Domain Routing