fragmentation fragmentation and reassembly are done by the ip layer fragmentation and reassembly are...

22
Fragmentation Fragmentation Fragmentation and reassembly are done Fragmentation and reassembly are done by the IP layer by the IP layer Identification (16 bits) Identification (16 bits) To identify fragments as pieces of the To identify fragments as pieces of the original (along with source and original (along with source and destination addresses, and “protocol” destination addresses, and “protocol” field) field)

Upload: jeremy-mills

Post on 31-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

FragmentationFragmentation

Fragmentation and reassembly are done by Fragmentation and reassembly are done by the IP layerthe IP layer

Identification (16 bits) Identification (16 bits)

– To identify fragments as pieces of the original To identify fragments as pieces of the original (along with source and destination addresses, (along with source and destination addresses, and “protocol” field)and “protocol” field)

Page 2: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

FragmentationFragmentation

Flags (3 bits)Flags (3 bits)– ““More” bitMore” bit– ““Don’t fragment” bitDon’t fragment” bit– UnusedUnused

Offset (13 bits)Offset (13 bits)– Offset in 8-byte units from the beginning of Offset in 8-byte units from the beginning of

the payload of the originalthe payload of the original

Page 3: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

FragmentationFragmentation

Id = abcd

Frag 1

Frag 2

Id = abcd,More = 1,Offset = 0

Id = abcd,More = 0,Offset = x

Page 4: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

FragmentationFragmentation Each fragment becomes a packet on its ownEach fragment becomes a packet on its own

– Routed independently of othersRouted independently of others

Reassembly timer at receiverReassembly timer at receiver

– If all fragments do not arrive by the reassembly time-If all fragments do not arrive by the reassembly time-out, original packet cannot be obtainedout, original packet cannot be obtained

– ICMP error generatedICMP error generated

IP: RFC 791IP: RFC 791

Page 5: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

Class B address: 144.16.x.y

144.16.68.22

144.16.68.25144.16.68.8

144.16.64.3

144.16.64.37

To theInternet

eth0

eth1

144.16.64.3 eth0

144.16.64.37 eth0

144.16.68.22 eth1

144.16.68.25 eth1

Routing table

Page 6: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

ProblemProblem

Too many entriesToo many entries

No way to aggregateNo way to aggregate

Can we Can we “extend” “extend” the network-id the network-id somehow?somehow?

Page 7: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

SubnettingSubnetting

The bits in the hostid part are further The bits in the hostid part are further divided:divided:

netid hostid

subnetid hostid

Page 8: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

Subnet masksSubnet masks

To extract the To extract the netidnetid and and subnetidsubnetid parts parts from the IP addressfrom the IP address

String of 1-s with trailing 0-s in the String of 1-s with trailing 0-s in the hostid hostid partpart

144 16 68 117

255 255 255 0

144 16 68 0

Bit-wise AND

Page 9: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

Class B address: 144.16.x.y

144.16.68.22

144.16.68.25144.16.68.8

144.16.64.3

144.16.64.37

To theInternet

eth0

eth1

144.16.64.* eth0

144.16.68.* eth1

Routing table

Page 10: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

Router operationRouter operation

Subnet mask: 255.255.255.0Subnet mask: 255.255.255.0

Router should store thisRouter should store this

Apply it to the D.A. field of incoming Apply it to the D.A. field of incoming packetpacket

Compare with 144.16.64.0 and Compare with 144.16.64.0 and 144.16.68.0144.16.68.0

Page 11: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

ForwardingForwarding

Compact routing tableCompact routing table

Example was with a routerExample was with a router– Same considerations for a host with multiple Same considerations for a host with multiple

interfacesinterfaces

Page 12: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

N/w C1 N/w C2 N/w C50

Page 13: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

N/w C1 N/w C2 N/w C50

Without subnetting

C1

C2

C50

Core routerC1

C2

C50

Core router

Page 14: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

SubnettingSubnetting

Imagine now that instead of 50 Class C Imagine now that instead of 50 Class C addresses, the organizations shared a addresses, the organizations shared a single Class B address with subnettingsingle Class B address with subnetting

Page 15: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

With subnetting

B

Core routerB

Core router

B1

B2

B50

Edge router

Page 16: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

Subnetting: drawbacksSubnetting: drawbacks The size of the routing tables in the The size of the routing tables in the core routers core routers

decreasesdecreases

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 hostsWith 50 Class C addresses: 50x254=12700 hosts

With a Class B address: 65534 hosts!With a Class B address: 65534 hosts!– Many addresses likely to be unusedMany addresses likely to be unused

Class B address space starting to get exhaustedClass B address space starting to get exhausted

Page 17: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

Earlier example againEarlier example again

N/w C1 N/w C2 N/w C50

C1

C2

C50

Core routerC1

C2

C50

Core router

Page 18: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

Aggregation again?Aggregation again?

What if the 50 Class C addresses are What if the 50 Class C addresses are allocated “nicely”, so that they can be allocated “nicely”, so that they can be aggregated?aggregated?

Leads to the idea of Leads to the idea of supernettingsupernetting

Page 19: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

SupernettingSupernetting

ExampleExample– C1: 194.51.2.0C1: 194.51.2.0– C2: 194.51.3.0C2: 194.51.3.0

33rdrd octet: octet:– 0000 00100000 0010– 0000 00110000 0011

Aggregation: 0000 Aggregation: 0000 001001

Single r.t. entry:Single r.t. entry:– 194.51. <194.51. <0000 001*>0000 001*>.*.*

Mask to be used: 23 Mask to be used: 23 bitsbits

Page 20: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

SupernettingSupernetting

N/w C1 N/w C2 N/w C50

Aggr C

Core router

Aggr C

Core router

Page 21: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

SupernettingSupernetting

Avoids routing table size explosionAvoids routing table size explosion

Also avoids wasted (unused) IP addressesAlso avoids wasted (unused) IP addresses

A “best of both worlds” solutionA “best of both worlds” solution

Key: allocate Class C addresses Key: allocate Class C addresses appropriately, so that aggregation is appropriately, so that aggregation is possiblepossible

Page 22: Fragmentation Fragmentation and reassembly are done by the IP layer Fragmentation and reassembly are done by the IP layer Identification (16 bits) Identification

CIDRCIDR With classes A, B and C, the number of With classes A, B and C, the number of

netid bits (i.e., “netmask length”) is netid bits (i.e., “netmask length”) is implicitly fixed: implicitly fixed: 8, 16 and 248, 16 and 24

But with aggregation, variable-length But with aggregation, variable-length netmasks are necessarynetmasks are necessary

ClasslessClassless Inter-Domain Routing Inter-Domain Routing