4 IP Address (IPv4) A unique 32-bit number Identifies an interface (on a host, on a router, …) Represented in dotted-quad notation
Network ID, Host ID, Gateway
خط فرضی = Netmask
Network Layer Addressing IP addresses 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to to to bits
Internet Classes (Class B) (Class C) (Class A) (Class D) (Class E) Class A, B are full; class C still has available addresses; D is reserved for multicasting and class E is reserved for future use
Network Layer Addressing Subnetting class C address Only 8 bits are available for hosts : possible subnet masks are: = = = = = = = = = = = = = = 254
28 IP Address and a 24-bit Subnet Mask Address Mask
30 Scalability Improved Number related hosts from a common subnet /24 on the left LAN /24 on the left LAN /24 on the right LAN /24 on the right LAN host LAN 1... host LAN 2... router WAN / /24 forwarding table
31 Classless Inter-Domain Routing (CIDR) IP Address : IP Mask: Address Mask for hostsNetwork Prefix Use two 32-bit numbers to represent a network. Network number = IP address + Mask Written as /15
32 CIDR: Hierarchal Address Allocation / / / / / /16 :::::: / /24 :::: / / / / / / /19 :::::: Prefixes are key to Internet scalability –Address allocated in contiguous chunks (prefixes) –Routing protocols and packet forwarding based on prefixes –Today, routing tables contain ~150, ,000 prefixes
33 Scalability: Address Aggregation Provider is given / / / / /23 Provider Routers in the rest of the Internet just need to know how to reach /21. The provider can direct the IP packets to the appropriate customer.
Netmasks and IP addresses The netmask splits the IP address into the network part and the host part. The address is and-ed with the netmask to determine the two parts E.g – , netmask IP: Mask: Net: Host: Net: Host: (less used)
© 2000, Cisco Systems, Inc. BSCN v1.0—3-35 Host Addresses E NetworkHost.. NetworkInterface E0 E1 Routing Table E0
© 2000, Cisco Systems, Inc. BSCN v1.0—3-36 IP Addressing network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) LAN
© 2000, Cisco Systems, Inc. BSCN v1.0—3-37 IP Addressing How to find the networks? Detach each interface from router, host create “islands of isolated networks Interconnected system consisting of six networks
© 2000, Cisco Systems, Inc. BSCN v1.0—3-38 Getting a datagram from source to dest. IP datagram: A B E misc fields source IP addr dest IP addr data l datagram remains unchanged, as it travels source to destination l addr fields of interest here Dest. Net. next router Nhops routing table in A:
© 2000, Cisco Systems, Inc. BSCN v1.0—3-39 Getting a datagram from source to dest A B E Starting at A, given IP datagram addressed to B: l look up net. address of B l find B is on same net. as A l link layer will send datagram directly to B inside link-layer frame n B and A are directly connected Dest. Net. next router Nhops misc fields data
© 2000, Cisco Systems, Inc. BSCN v1.0—3-40 Getting a datagram from source to dest A B E Dest. Net. next router Nhops Starting at A, dest. E: l look up network address of E l E on different network n A, E not directly attached l routing table: next hop router to E is l link layer sends datagram to router inside link- layer frame l datagram arrives at l continued….. misc fields data
© 2000, Cisco Systems, Inc. BSCN v1.0—3-41 Getting a datagram from source to dest A B E Arriving at , destined for l look up network address of E l E on same network as router’s interface n router, E directly attached l link layer sends datagram to inside link-layer frame via interface l datagram arrives at !!! (hooray!) misc fields data network router Nhops interface Dest. next
Netmasks - the easy way The scope of a network is defined by the network mask: Class B network example Address: Mask: Class C network example Address: Mask: Scope: Scope:
Router’s operations At each hop the data link layer frame is changed but the packets above never change
44 Are 32-bit Addresses Enough? Not all that many unique addresses 2 32 = 4,294,967,296 (just over four billion) 2 32 = 4,294,967,296 (just over four billion) Plus, some are reserved for special purposes Plus, some are reserved for special purposes And, addresses are allocated in larger blocks And, addresses are allocated in larger blocks And, many devices need IP addresses Computers, PDAs, routers, tanks, toasters, … Computers, PDAs, routers, tanks, toasters, … Long-term solution: a larger address space IPv6 has 128-bit addresses (2 128 = × ) IPv6 has 128-bit addresses (2 128 = × ) Short-term solutions: limping along with IPv4 Private addresses Private addresses Network address translation (NAT) Network address translation (NAT) Dynamically-assigned addresses (DHCP) Dynamically-assigned addresses (DHCP)
46 IPv6 Header compared to IPv4 Header Ver. Time to Live Source Address Total Length Type of Service Hdr Len Identification Fragment Offset Flg Protocol Header Checksum Destination Address Options... Ver. Traffic Class Source Address Payload Length Next Header Hop Limit Destination Address Hdr Len Identification Fragment Offset Flg Header Checksum Options... shaded fields have no equivalent in the other version IPv6 header is twice as long (40 bytes) as IPv4 header without options (20 bytes) Flow Label