Presentation is loading. Please wait.

Presentation is loading. Please wait.

Winter 20021 CMPE 155 Week 8. Winter 20022 Router demos: background.

Similar presentations


Presentation on theme: "Winter 20021 CMPE 155 Week 8. Winter 20022 Router demos: background."— Presentation transcript:

1 Winter 20021 CMPE 155 Week 8

2 Winter 20022 Router demos: background

3 Winter 20023 IP Datagram Format IP datagram consists of header and data (or payload). Header (IPv4): –20-byte fixed (mandatory) part. –Variable length optional part.

4 Winter 20024 IP Header 32 bits Version Header length Type of service Total length IdentificationFragment offset DM TTL ProtocolHeader checksum Source address Destination address Options U

5 Winter 20025 IP Functions Type of Service –Not used until recently. Identification, Flags and Fragment Offset –Fragmentation. Time to live –Bounded delivery. Protocol –(De)multiplexing higher layer protocols.

6 Winter 20026 Other Fields Length –IP packet length limited to 64K. Header checksum –Ensures some degree of header integrity.

7 Winter 20027 Fragmentation Networks are different! –Different speed and error rates! Maximum Transmission Unit (MTU). –Larger in more reliable, faster networks. –1,536 bytes on 10Mbs Ethernets, 4,096 bytes on 100 Mbps FDDI ring. Router between FDDI and Ethernet. –Either refuses packet, or –Chop it into fragments.

8 Winter 20028 IP Fragmentation IP header includes identification, flags, and offset fields. –Flags: DF (don’t fragment) and MF (more fragments). –Identification: same for all packet fragments. –Offset: relative fragment position within packet.

9 Winter 20029 How hosts find one another? Internet Computer1

10 Winter 200210 Packet traveling over Internet R R R R R HH H H H R R H R H: Hosts R: Routers Routers send packet to next closest point

11 Winter 200211 Addressing Domain name (e.g. www.ucsc.edu) –Global, human readable name. DNS translates name to IP address. (e.g. 128.114.129.49) –Global, understood by all networks. Finally, we need local net address. –E.g., Ethernet (08-00-2c-19-dc-45) –Local, works only on a particular network.

12 Winter 200212 Finding IP Address: Domain Name System (DNS) What’s the IP address for www.ucsc.edu? Computer 1 It is 128.114.129.49

13 Winter 200213 Finding Ethernet Address: Address Resolution (ARP) Ethernet Broadcast: who knows the Ethernet address for 128.125.51.41? Ethernet Broadcast: it is 08-00-2c-19-dc-45

14 Winter 200214 Addressing in IP IP addresses are names of interfaces. DNS names are names of hosts. DNS binds host names to interfaces. Routing binds interface names to paths.

15 Winter 200215 Addressing Considerations Fixed length or variable length? Issues: –Flexibility. –Processing costs. –Header size. IP uses fixed-length addresses. IP uses hierarchical addresses.

16 Winter 200216 IP Addresses Every host and router on the Internet must have an IP address. Fixed length: 32 bits. 2-level hierarchy: –Network number. –Host number. Notations: –Binary: 10000000 00000110 11110000 00000011 –Dotted decimal: 128.6.240.3

17 Winter 200217 IP Address Formats 1 4 different classes: 0XXXXXXX NetworkHost 10XXXXXXXXXXXXXX 110XXXXXXXXXXXXX 1110XXXXXXXXXXXX Class A: 128 nets. 16M hosts/net. Class B: 16K nets. 64K hosts/net. Class C: 2M nets. 256 hosts/net. Class D: Multicast.

18 Winter 200218 Class sizes Total IP address space: 4 billion Class A: 128 networks, 16M hosts. –1~127. Class B: 16K networks, 64K hosts. –128~191. Class C: 2M networks, 256 hosts. –192~223.

19 Winter 200219 Some special IP addresses 127.0.0.1: local host (a.k.a. the loopback address. 127.x.x.x: same as above. Host bits all set to 0: network address. Host bits all set to 1: broadcast address. 0.0.0.0: this host on this network.

20 Winter 200220 Multi-addresses A router usually has more than one IP address. Multi-homed host: host with multiple network interfaces each of which has different IP address. 80.0.0.0 236.240.128.0 129.98.0.0 129.98.95.1 236.240.128.3 80.0.0.8

21 Winter 200221 Management Network numbers assigned by single authority: NIC (network information center). All hosts in a network must have same network number. What if networks grow?

22 Winter 200222 Scalability Example: company starts with 1 class C LAN, thus can connect up to 256 hosts. –It might grow to more than 256 hosts. –It might get more LANs. –For every new LAN, need new network number from NIC. –Moving machines between LANs needs address change.

23 Winter 200223 Subnetting (1) Split address space into several “internal” subnets. –Still act like single network to outside world. Example: Class B address. 10XXXXXXXXXXXXXXHHHHHHHH 10XXXXXXXXXXXXXXSSSSSSHHHHHHHHHH Class B: 16K nets. 64K hosts/net Class B with subnetting: 62 LANs, 1022 hosts each. 1st. subnet: 130.50.4.1 2nd. subnet: 130.50.8.1

24 Winter 200224 Subnetting 2 Routing: hierarchical. –(network, -) entries: distant hosts. –(this network, host) entries: local hosts. –Routers only need to keep track of other networks and local hosts. With subnetting: –(network, -) entries: distant hosts. –(this network, subnet, -). –(this network, this subnet, host). –Adds extra hierarchical level => smaller RTs.

25 Winter 200225 Subnet Mask Used to compute the subnet number; i.e., gets rid of the host number. –Facilitates routing table look-up. –IP address AND subnet mask = subnet # Example: 10XXXXXXXXXXXXXXSSSSSSHHHHHHHHHH 11111111 11111111 11111100 00000000 Ex: 130.50.15.6 AND subnet mask = 130.50.12.0, which is subnet 3.

26 Winter 200226 Subnetting Example Assume an organization was assigned address 150.100. Assume < 100 hosts per subnet. How many host bits do we need? –7. What is the network mask? –11111111 11111111 11111111 10000000. –255.255.255.128

27 Winter 200227 Using Subnet Mask Assume a packet arrives with address 150.100.12.176. Step 1: AND address with subnet mask –(150.100.12.176) AND (255.255.255.128) –result: 150.100.12.128 which is the target network. Target network has hosts in the range –150.100.12.129 - 150.100.12.254.

28 Winter 200228 Subnet Addressing Example H1H2 H3H4 H5 R1 R2 150.100.12.128 150.100.12.154150.100.12.176 150.100.12.129 150.100.12.0 150.100.12.4 To Internet 150.100.12.1 150.100.15.54 150.100.15.0 150.100.15.11 150.100.12.55150.100.12.24 150.100.0.1

29 Winter 200229 Routing to the network H1H2 H3H4 H5 R1 R2 150.100.12.128 150.100.12.154150.100.12.176 150.100.12.129 150.100.12.0 150.100.12.4 To Internet 150.100.12.1 150.100.15.54 150.100.15.0 150.100.15.11 150.100.12.55150.100.12.24 150.100.0.1 A packet destined to 150.100.15.11 arrives. R1 applies a 9-bit subnet mask and gets the address 150.100.15.0. R1 looks up its routing table and sends the packet to R2.

30 Winter 200230 Routing within the subnet H1H2 H3H4 H5 R1 R2 150.100.12.128 150.100.12.154150.100.12.176 150.100.12.129 150.100.12.0 150.100.12.4 To Internet 150.100.12.1 150.100.15.54 150.100.15.0 150.100.15.11 150.100.12.55150.100.12.24 150.100.0.1 H5 wants to send pkt to H2. Destination Next hopInterface 127.0.0.1 150.100.15.0 default 127.0.0.1 lo0 150.100.15.54 150.100.15.11 emd0 Routing table at H5 Lookup rules: exact match network match default route Search for longest matching prefix

31 Winter 200231 Routing within the subnet H1H2 H3H4 H5 R1 R2 150.100.12.128 150.100.12.154150.100.12.176 150.100.12.129 150.100.12.0 150.100.12.4 To Internet 150.100.12.1 150.100.15.54 150.100.15.0 150.100.15.11 150.100.12.55150.100.12.24 150.100.0.1 From H5, Packet reaches R2. R2 delivers the packet to R1. Destination Next hopInterface 127.0.0.1 150.100.15.0 default 127.0.0.1 lo0 150.100.12.4 150.100.15.11 emd0 emd1 Routing table at R2 150.100.12.0150.100.12.1 emd0

32 Winter 200232 Routing within the subnet H1H2 H3H4 H5 R1 R2 150.100.12.128 150.100.12.154150.100.12.176 150.100.12.129 150.100.12.0 150.100.12.4 To Internet 150.100.12.1 150.100.15.54 150.100.15.0 150.100.15.11 150.100.12.55150.100.12.24 150.100.0.1 R1 has direct route and delivers packet to H2. Destination Next hopInterface 127.0.0.1 150.100.12.0 127.0.0.1 lo0 150.100.12.4 emd0 emd1 Routing table at R1 150.100.15.0150.100.12.1 emd1 150.100.12.176

33 Winter 200233 IP Address Problem Exponential growth of the Internet! –Address space depletion. –Danger of running out of classes A and B. –32-bit address fields are getting too small. –Early predictions: it’d take decades to achieve 100,000 network mark. –100,000th. network was connected in 1996! –Internet is rapidly running out of IP addresses! –Waste due to hierarchical address.

34 Winter 200234 IP Address Scalability Class A addresses: 16M hosts is usually too much. Class C addresses: 254 hosts is usually too small. Class B addresses provide room for 64K hosts. –Organizations usually request class B addresses but more than 50% of them only have up to 50 hosts!

35 Winter 200235 Scaling IP Addresses Class C addresses should have 10-bit host numbers instead of only 8-bit numbers. –Would allow for 1022 hosts instead of just 254. –More Class C networks: network number can grow up to 0.5M. But, could result in routing table explosion. –Routers will have to know about many more networks.

36 Winter 200236 CIDR (1) Classless Interdomain Routing: RFC 1519. No longer uses classes A, B, and C addresses. Allocate remaining Class C addresses in variable-sized blocks. –Example: if an organization needs 2000 addresses, it’s given a block of 2048 addresses, or 8 contiguous class C networks and not a full class B address.

37 Winter 200237 CIDR (2) New allocation rules for class C addresses. World partitioned into 4 zones and each one was given portion of class C address space (192~223). –192.0.0.0~195.255.255.255: Europe. –198.0.0.0~199.255.255.255: North America. –200.0.0.0~201.255.255.255: Central and South America. –202.0.0.0~203.255.255: Asia and Pacific.

38 Winter 200238 CIDR (3) Each region is allocated ~ 32M class C addresses. Addresses 204.0.0.0~223.255.255.255 reserved for future use. Advantages: – Less waste. – Routing table aggregation: Routers need only one RT entry per region, i.e., 32M addresses compressed into one.

39 Winter 200239 CIDR (4) Once packet gets to its destination region, need more detailed routing information. One possibility is to keep 131,072 (32M/2 8 ) entries for all “local” networks. –Explosion problem. Instead, use of 32-bit masks: only need to keep start address of block.

40 Winter 200240 CIDR - Example (1) Cambridge University has 2048 addresses from 194.24.0.0~194.24.7.255 and mask 255.255.248.0. Oxford University: 4096 addresses 194.24.16.0~194.24.31.255 with mask 255.255.240.0. U of Edinburgh: 1024 addresses 194.24.8.0~194.24.11.255 and mask 255.255.252.0.

41 Winter 200241 CIDR - Example (2) Routing tables in Europe contain base address and mask: AddressMask 11000010 00011000 00000000 00000000 11111111 11111111 11111000 00000000 11000010 00011000 00010000 00000000 11111111 11111111 11110000 00000000 11000010 00011000 00001000 00000000 11111111 11111111 11111100 00000000 When packet to 194.24.17.4 ( 11000010 00011000 00010001 00000100 ) arrives, it’s ANDed with Cambridge U’s mask yielding 11000010 00011000 00010000 00000000 which does not match Cambridge U’s base. When it’s ANDed with Oxford’s mask, it matches Oxford’s base, so packet sent to Oxford’s router.


Download ppt "Winter 20021 CMPE 155 Week 8. Winter 20022 Router demos: background."

Similar presentations


Ads by Google