Winter CMPE 155 Week 8
Winter Router demos: background
Winter IP Datagram Format IP datagram consists of header and data (or payload). Header (IPv4): –20-byte fixed (mandatory) part. –Variable length optional part.
Winter IP Header 32 bits Version Header length Type of service Total length IdentificationFragment offset DM TTL ProtocolHeader checksum Source address Destination address Options U
Winter 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.
Winter Other Fields Length –IP packet length limited to 64K. Header checksum –Ensures some degree of header integrity.
Winter 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.
Winter 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.
Winter How hosts find one another? Internet Computer1
Winter 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
Winter Addressing Domain name (e.g. –Global, human readable name. DNS translates name to IP address. (e.g ) –Global, understood by all networks. Finally, we need local net address. –E.g., Ethernet ( c-19-dc-45) –Local, works only on a particular network.
Winter Finding IP Address: Domain Name System (DNS) What’s the IP address for Computer 1 It is
Winter Finding Ethernet Address: Address Resolution (ARP) Ethernet Broadcast: who knows the Ethernet address for ? Ethernet Broadcast: it is c-19-dc-45
Winter 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.
Winter Addressing Considerations Fixed length or variable length? Issues: –Flexibility. –Processing costs. –Header size. IP uses fixed-length addresses. IP uses hierarchical addresses.
Winter 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: –Dotted decimal:
Winter 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.
Winter 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.
Winter Some special IP addresses : 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 : this host on this network.
Winter 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
Winter 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?
Winter 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.
Winter 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: nd. subnet:
Winter 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.
Winter 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 Ex: AND subnet mask = , which is subnet 3.
Winter Subnetting Example Assume an organization was assigned address Assume < 100 hosts per subnet. How many host bits do we need? –7. What is the network mask? – –
Winter Using Subnet Mask Assume a packet arrives with address Step 1: AND address with subnet mask –( ) AND ( ) –result: which is the target network. Target network has hosts in the range –
Winter Subnet Addressing Example H1H2 H3H4 H5 R1 R To Internet
Winter Routing to the network H1H2 H3H4 H5 R1 R To Internet A packet destined to arrives. R1 applies a 9-bit subnet mask and gets the address R1 looks up its routing table and sends the packet to R2.
Winter Routing within the subnet H1H2 H3H4 H5 R1 R To Internet H5 wants to send pkt to H2. Destination Next hopInterface default lo emd0 Routing table at H5 Lookup rules: exact match network match default route Search for longest matching prefix
Winter Routing within the subnet H1H2 H3H4 H5 R1 R To Internet From H5, Packet reaches R2. R2 delivers the packet to R1. Destination Next hopInterface default lo emd0 emd1 Routing table at R emd0
Winter Routing within the subnet H1H2 H3H4 H5 R1 R To Internet R1 has direct route and delivers packet to H2. Destination Next hopInterface lo emd0 emd1 Routing table at R emd
Winter 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.
Winter 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!
Winter 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.
Winter CIDR (1) Classless Interdomain Routing: RFC 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.
Winter 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). – ~ : Europe. – ~ : North America. – ~ : Central and South America. – ~ : Asia and Pacific.
Winter CIDR (3) Each region is allocated ~ 32M class C addresses. Addresses ~ 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.
Winter 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.
Winter CIDR - Example (1) Cambridge University has 2048 addresses from ~ and mask Oxford University: 4096 addresses ~ with mask U of Edinburgh: 1024 addresses ~ and mask
Winter CIDR - Example (2) Routing tables in Europe contain base address and mask: AddressMask When packet to ( ) arrives, it’s ANDed with Cambridge U’s mask yielding 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.