Lecture 2: The Internet Protocol Literature: Forouzan: ch 4-9 and ch 27 2004 Image Coding Group, Linköpings Universitet
Outline About the network layer Tasks Addressing Routing Protocols 2
Tasks of the network layer Source to destination delivery of packets (across multiple networks) Logical addressing - addresses valid over network borders Routing Fragmentation and reassembly 3
Logical vs Physical Addresses Each network interface card (NIC) has a physical address, eg MAC addresses. They are enough within a LAN, but give no routing help outside the local area. Logical addresses were created to help with communication between networks. Nodes within a LAN have neighbouring IP addresses. All traffic to the network can be routed using the common part of the addresses in the LAN, the network address. 4
Addressing 32 bit addresses in IPv4 -->approx 4300 million addresses available. Dotted decimal notation, eg. 198.36.42.18 Sometimes hexadecimal notation is used, eg 0xC6242A12 5
Multihomed Devices 6
Classful Addressing Addresses are assigned in blocks where the block size is defined by the chosen class. Classes A-E. The first byte defines the class. Note! This is an obsolete addressing scheme! (They are still in use though...) Many organisations have been assigned more addresses than they need! One reason we are running out of addresses! 7
Classful addressing Figures from Forouzan 8
NetID and HostID 9
Addresses and netmasks The network address is the first address in a block. The broadcast address is the last address in a block. A network mask is a 32 bit number such that the network address can be found by applying (bitwise, logical AND) the mask to any address in the block. 10
Using more addresses Several techniques have been developed to lower the number of wasted addresses, eg.: Subnetting - divide a block into subnets using netmasks. Supernetting - combine blocks into supernets using netmasks. Classless addressing - no classes In all cases the number of nets must be a power of 2 11
With and without subnetting Figure from Forouzan 12
Subnetting example A company is given the site address 201.70.64.0 (class C). The company needs six subnets. Design the subnets! 13
Example solution The number of 1s in the default mask is 24 (class C). The company needs six subnets. This is not a power of 2, so we will create eight subnets (8=23). We need three more 1s in the subnet mask, making it 27 in total The number of 0s is 32-27=5, so the mask is: 11111111 11111111 11111111 11100000 or 255.255.255.224 14
Example solution Figure from Forouzan 15
A Supernetwork Figure from Forouzan 16
Supernet example We made a supernetwork out of 4 class C blocks. What is the supernet mask? We are using 4 blocks. For 4 blocks we need to change two 1s to 0s in the default mask. So the mask is: 11111111 11111111 11111100 00000000 or 255.255.252.0 17
Classless Addressing Addresses are assigned in blocks of variable size. One restriction is that the size of the block should be a power of 2. Slash notation - short form of network mask A.B.C.D/n where n is the number of 1s in the network mask. 18
Delivery and Routing Direct or indirect delivery Connection-oriented or connectionless service Routing tables - gets huge next-hop network specific default routing static or dynamic 19
Direct vs Indirect delivery Figure from Forouzan 20
Next-hop routing Figure from Forouzan 21
Network Specific Routing Figure from Forouzan 22
Default Routing Figure from Forouzan 23
Static or Dynamic Routing Static routing routing table is entered manually Dynamic routing routing table is periodically updated using a dynamic routing protocol, like RIP, OSPF or BGP. 24
Protocols Figure from Forouzan 25
ARP Maps logical addresses to physical addresses. ARP requests are broadcasts on the LAN. An ARP packet is encapsulated directly into a data link frame. Figure from Forouzan 26
ARP Communication Figure from Forouzan 27
Proxy ARP Figure from Forouzan 28
RARP Maps physical addresses to logical addresses. RARP requests are broadcast on the LAN A RARP packet is encapsulated directly into a data link frame There are newer and better alternatives to RARP BOOTP DHCP Figure from Forouzan 29
RARP Communication Figure from Forouzan 30
The Internet Protocol (IP) Unreliable Connectionless A best effort delivery service 31
Datagram Figure from Forouzan 32
Fragmentation Maximum transfer unit (MTU) Each data link layer protocol use its own frame format. Fragmentation needed when passing to a network with a smaller MTU (IPv4). MTU examples: Hyperchannel - 65535 bytes Ethernet - 1500 bytes PPP - 296 bytes 33
Options Options are used for testing and debugging purposes Figure from Forouzan 34
Checksum Redundant information added that is used for error detection The checksum is constructed as follows: 1. Divide the packet into k sections, each of n bits 2. All sections are added together using one's complement arithmetic. (We will look at this during Class 1) 3. The result is complemented to make the checksum 35
ICMP Messages are encapsulated in IP datagrams. Two types of messages: Error reporting Dest. unreachable Source quench Time exceeded Parameter problems Redirection Query Echo request and reply Timestamp request and reply Address-mask request and reply Router solicitation and advertisement Figure from Forouzan 36
IPv6 Addressing Packet format Extension headers Difference from IPv4 Transition from IPv4 to IPv6 37
IPv6: Addressing There is a new addressing system in IPv6: 128 bit addresses new notation (hexadecimal colon notation) eg. FDEC:BA33:0000:0000:FFCD:03F1:0000:0001 ( or FDEC:BA33::FFCD:3F1:0:1) slash notation supported Three types of addresses unicast anycast multicast Address structure 128 bits variable Type Prefix Rest of address Figure from Forouzan 38
Address Space Assignments Type Prefix 0000 0000 010 1111 1110 10 1111 1110 11 1111 1111 Type Reserved Provider based addresses Link local addresses Site local addresses Multicast addresses Fraction 1/256 1/256 1/1024 1/1024 1/256 Unspecified Loopback IPv4 Type 3 bits Registry id 5bits Provider id 16 bits Subscriber id 24 bits Subnet id 32 bits Node id 48 bits 39
IPv6 Datagram Figure from Forouzan 40
Datagram format Figure from Forouzan 41
Extension headers (options) Hop-by-hop option Pad1 PadN Jumbo payload Source routing Fragmentation Authentication Encrypted Security Payload Destination Option (No Next Header) 42
Extension Header Format Figure from Forouzan 43
Difference from IPv4 (Much) larger address space Better header format New options Prepared for extensions Support for resource allocation (flow label) Support for more security 44
Transition Strategies Dual stack - hosts keep a dual stack of protocols, thus running IPv4 and IPv6 simultaneously. Tunneling - passing IPv6 packets through a region where IPv4 is used. Automatic Configured Header translation - when only a few hosts use IPv4 45
ICMPv6 Message format Difference from ICMPv4 46
What's new? ARP and IGMP included in ICMPv6 RARP dropped Error report IGMP Source quench report dropped Packet too big report added ICMP - Query - Timestamp query dropped - Address mask query dropped ICMP IP IP ARP RARP Network layer in version 4 Figures from Forouzan Network layer in version 6 47
ICMPv6 message format Figure from Forouzan 48
ICMPv6 Error Messages Destination Unreachable Packet Too Big Time Exceeded Parameter Problem 49