1 Ch 10 Layer 3 Routing Addressing Laboratorium
1
Ch 10. Layer 3: Routing & Addressing Laboratorium Telematika - ITB Cisco Regional Networking Academy Semester 1 Version 2. 1. 1 Duration: 90 minutes 2
Overview n Network layer is responsible for routing, navigating the data through the network. u Best path selection, and switching the data to the destination. n n Router use and operation. IP addressing. u Classes A, B & C for general use. u Classes D & E are reserved. n Subnetting u Subnetworks and subnet masks. u IP addressing schemes. 3
Network Layer Addressing n Network layer's addressing scheme is used to: u Represent the path. u Determine the destination of data. n Network addressing is hierarchical, has logical structure. Addresses represent path of media connections. 4
Network Layer Addressing (cont. ) n In general, have two parts: u network address. u host (node) address. F Host addresses on a network must be unique. F Host or node address identifies the specific port or device. n Network Layer addressing enables segmentation u Reduces congestion u Reduces broadcasts 5
Flat vs Hierarchical Addressing n Network address u Hierarchical, has logical structure (e. g. IP address) F Like zip code, postcode or area code. u Identifies n the network. Host address u Flat addressing scheme (e. g. MAC address). F Like personal name. u Identifies the host. 6
Communications among Networks n The Internet is a collection of interconnected networks or autonomous systems. u Autonomous system - networks under a common administration, using a common routing strategy. n Internet service providers (ISPs) offer services that tie together multiple networks. 7
Routers n Routers are OSI Layer 3 (the network layer) that interconnect, networks or subnetworks. u They pass data packets between networks based on network (layer 3) protocol information. n Routers selects best path for the delivery of data and then direct packets to the appropriate output port and segment. u Routing is often referred to as Layer 3 switching. u Recall: routers do F (1) Path selection; F (2) Communicate path information; F (3) Switching function. 8
Path Determination n One of the primary functions of network layer is path determination. u Process to choose the next hop in the path. u Also called routing the packet. 9
IP Header 0 4 VERS 8 HLEN 16 Service Type Identification Time To Live 32 Total Length Flags Protocol Fragment Offset Header Checksum Source IP Address Destination IP Address IP Options (if any) Padding Data 10
IP Header (cont. ) n n n n VERS - IP version, currently 4. HLEN - header length (in 32 -bit words). Service Type - specifies the level of importance, assigned by a particular upper-layer protocol. Total Length - length of entire IP packet (in bytes). Identification, Flags, Frag Offset - provides for fragmentation of packets (for differing MTUs). Time to Live (TTL) - time packet is considered valid; on reaching 0 packet is discarded. Protocol - upper layer (Layer 4) protocol. 11
IP Header (cont. ) n n n Header checksum - for error checking, helps ensure IP header integrity. Source & Destination IP addresses. IP Options - network testing, debugging, security, etc. Padding - extra zeros added to ensure that the IP header is always a multiple of 32 bits. Data - segment from transport layer. 12
What is IP Addressing? n n n IP address is a logical address, configured in software. Each device has a unique IP address is a 32 bit number. u Represented as 4 groups of 8 bits (octets or bytes). u Usually written as dotted decimal. 1 Byte ( 8 bits ) 11000000101 0010 00001011 192 . 5 . 34 . 11 13
Dotted Decimal Format n Consider an example IP address (32 bits): u 11010011. 00101101. 01110011. 00010011 n We need to find a decimal value for each octet. u 11010011(binary) = 211 (decimal). u 00101101(binary) = 45 (decimal). u 01110011(binary) = 115 (decimal). u 00010011(binary) = 19 (decimal). n In dotted decimal, the IP address is: u 211. 45. 115. 19 n What is the largest decimal value for any octet? 14
IP Addressing n IP address is structured or hierarchical. u Network ID. Host ID (2 level). F Network ID identifies the network. F Host ID identifies the actual device or node. n Divided into 5 classes. u Class A - net. host u Class B - net. host u Class C - net. host u Class D & E - used for multicasts and experimental purposes. 15
IP Addressing (cont. ) n Organizations can obtain IP addresses from ARIN (American Registry for Internet Numbers). u Classes A, B, and C are available. u In Asia-Pacific region, contact APNIC. n n n Class A addresses - for governments around the world. Class B addresses - for medium-sized companies. Class C addresses - for all others. 16
IP Class A n n Format: Network. Host. First octet begins with 0 (most significant bit). u First octet has decimal values from 0 to 126. u Note: 127 is reserved for special purpose. n Class A is a very large network. u 27 class A networks (128, only 126 are valid) u 224 = 16, 777, 216 hosts per network (16, 777, 214 valid - all 0 s and all 1 s are not assigned). 24 bits Network Host 17
IP Class B n n Format: Network. Host First octet begins with 10 (most significant bits). u First n octet has decimal values from 128 to 191. Class B is an intermediate size network. u 214 class B networks. u 216 = 65, 536 hosts per network (65, 534 valid). 16 bits Network Host 18
IP Class C n n Format: Network. Host First octet begins with 110 (most significant bits). u First n octet has decimal values from 192 to 223. Class C is a small network. u 221 networks. u 28 = 256 hosts per network (254 valid). 8 bits Network Host 19
IP Reserved Addresses n For each network, two addresses are reserved. u All 0 s host ID - used as part of the network address or wire address. u All 1 s host ID - used as part of the broadcast address. n Example for class B address u Network address 150. 20. 0. 0 (all host bits 0). u Directed broadcast address is 150. 255 (all host bits 1). n Local broadcast address is 255, all bits are 1 s. u Defaults to local network. 20
IP Address Range Example n Class C 200. 10. 0 u 24 bits (first 3 octets) are network ID, 8 bits (4 th octet) are host bits. u For all possible host combinations, we get 200. 10. 0 to 200. 10. 255. u First address is the network address or wire address (host ID all 0 s). u Last address is the network broadcast address (host ID all 1 s). u Allowable host addresses are 200. 10. 1 to 200. 10. 254. 21
IP Address Range Example (cont. ) n Remember: u 1) First address in each network is reserved for the actual network address (or network number). u 2) The last address in each network is reserved for broadcasts. u 3) The rest of the addresses are assignable to various hosts. 22
Significance of Network ID n Hosts on a network can only communicate directly with devices with the same network ID. u Even if they are physically connected, they must have same network ID to communicate directly. u If two hosts have different network numbers, they need another device that can make a connection between the networks: router. n Note: the rest of the world sees our network as a single network, represented by the network address. 23
Subnetting n To provide addressing flexibility, networks, particularly large networks, need to be divided into smaller networks, called subnetworks or subnets. u Subnet addresses are assigned locally, usually by the network administrator. n Each subnet address must be unique. 24
Subnetting (cont. ) n To create a subnet address, bits are borrowed from the original host portion and designated as the subnet field. Host Network n Network Subnet Host Primary reason for using subnets is to reduce the size of a broadcast domain. 25
Subnetworks (2) n Minimum number of bits for subnet is 2. u ‘All 0 s’ subnet, and ‘all 1 s’ subnet are not assigned. u 2 n-2 usable subnets, where n = no. of subnet bits. n Note: Number of host bits are less. u Fewer n users per subnet (segmentation). Network bits (ID) are unchanged. u Rest of the world still sees our network as a single network (network address). 26
Subnet Mask n n Subnet mask (formal term: extended network prefix), tells network devices which part is network field and which part is host field. Subnet mask is 32 bit (dotted decimal. u All network and subnet bits are set to 1 s. u All host bits are set to 0 s. 27
Decimal Equivalents of Bit Patterns 28
Router’s use of Subnet Mask n To route a data packet, the router must first determine destination network/subnet address by performing a logical AND using destination host's IP address and subnet mask. Class B, 8 bits borrowed. 0000 29
Subnet Bits n n Maximum varies by address class. Address Size of Maximum Number Class Host Field of Subnet Bits u u u n A B C 22 14 6 Must have min of 2 host bits. u Minimum n 24 16 8 number of subnet bits is 2. Some devices can use the zero subnet. 30
Alternative Subnet Mask Format n Uses a ‘bit-count’ format: u 255. 0. 0. 0 is /8 (eight ‘ 1’ bits) u 255. 0. 0 is /16 (sixteen ‘ 1’ bits) u 255. 240. 0 is /20 (twenty ‘ 1’ bits) 31
Private Addresses n Certain addresses in each class of IP address that are not assigned - private addresses. u Used with Network Address Translation (NAT), or with a proxy server, to connect to a public network. u Can be used in stand-alone network. n Private address ranges will NOT be routed on the Internet. 32
Summary n n Network layer functions include network addressing and best path selection. Network layer address is composed of: u Network address — Hierarchical. u Host address — Flat. n Class A, B, and C are used for Internet addressing. u Class A addresses - for governments. F High-order bit is 0; first octet - 1 to 126. u Class B addresses - for medium-size companies. F High-order bits are 10; first octet - 128 to 191. 33
Summary (cont. ) u Class C addresses - for all others. F High-order n bits are 110; first octet - 192 to 223. Subnetting - adding additional logical structure to network addressing. u Bits are borrowed from host to create subnet. u Subnet mask - indicates which bits are network and subnet, and which are hosts. n Private IP Addresses u Class A: 10. 0, subnet mask 255. 0. 0. 0 u Class B: 172. 16. 0. 0, subnet mask 255. 240. 0. 0 u Class C: 192. 168. 0. 0, subnet mask 255. 0. 0 34
The End 35
- Slides: 35