* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Document
Piggybacking (Internet access) wikipedia , lookup
Distributed firewall wikipedia , lookup
Airborne Networking wikipedia , lookup
Asynchronous Transfer Mode wikipedia , lookup
Network tap wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Point-to-Point Protocol over Ethernet wikipedia , lookup
Computer network wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
SIP extensions for the IP Multimedia Subsystem wikipedia , lookup
Deep packet inspection wikipedia , lookup
Internet protocol suite wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Real-Time Messaging Protocol wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Chapter 20 Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv6 McGraw-Hill 1 ©The McGraw-Hill Companies, Inc., 2004 Protocols at Network Layer McGraw-Hill IP is responsible for host-to-host delivery of datagrams from source to destination. ARP: Find the MAC (Physical) address of the next hop. Data link layer encapsulates this address into the frame ICMP: Handle unusual situations such as the occurrence of an error. IP is meant for unicast. For Multicast, we need IGMP. 2 ©The McGraw-Hill Companies, Inc., 2004 ARP McGraw-Hill Hosts and routers are recognized at the network level by their IP addresses. IP is unique. At physical network level, we use MAC. MAC is unique locally but not necessarily universally. We need both IP and MAC address because a physical network, such as Ethernet, can have two different protocols at the network layer, such as IP and IPX (Novell), at the same time. Likewise, a packet at a network layer such as IP may pass through different physical networks, such as Ethernet and Token Ring. IP and MAC address need to be mapped. 3 ©The McGraw-Hill Companies, Inc., 2004 ARP mapping Static Mapping Having a table of IP and MAC address mapping in all the machines. Limitations if MAC address changes due to Change of network card In LocalTalk, MAC address changes when a machine is turned on A mobile computer can move from one network to another and so can gain different MAC address. Dynamic mapping McGraw-Hill Each machine knows one of the two addresses. Use a protocol to get the other address. ARP & RARP. RARP is now replaced by DHCP. ARP associates an IP address with its MAC address. 4 ©The McGraw-Hill Companies, Inc., 2004 ARP Operation McGraw-Hill ARP request has the sender’s IP and MAC & the receiver’s IP address. It’s a broadcast as the physical address of the receiver is unknown. All hosts in the network processes this request but only the intended recipient responds. Response is unicast. 5 ©The McGraw-Hill Companies, Inc., 2004 ARP Packet Format McGraw-Hill Hardware Type: 16-bits; Defining the type of network; Ethernet is 1. Protocol Type: 16-bits; IPv4 is 0800. Hardware and Protocol length is 8-bits. 6 ©The McGraw-Hill Companies, Inc., 2004 Encapsulation of ARP Packet Start of Frame Delimiter -SDF McGraw-Hill 7 ©The McGraw-Hill Companies, Inc., 2004 Delivery of the Datagram Sender knows the IP address of the target. IP asks ARP to create ARP request message. It includes sender’s and target’s IP and physical addresses. Target Physical address is all 0s. Message is passed to data link layer, encapsulated in a frame using sender’s physical address. The physical destination address is the broadcast address. All machines drop the packet except the targeted machine. Target machine identifies the IP address. Target machine sends the ARP reply with its physical address. Sender receives the reply and knows the physical address of target. IP datagram, carries data for target machine, is now encapsulated in a frame and is unicast to the destination. McGraw-Hill 8 ©The McGraw-Hill Companies, Inc., 2004 Four cases using ARP McGraw-Hill 9 ©The McGraw-Hill Companies, Inc., 2004 Four cases using ARP Case 1: Map the destination IP address to the physical address of the destination host (host MAC). Case 2: Map the IP address of the router to the physical address (router MAC). Case 3: IP of next router is mapped to the physical address (MAC of next router) Case 4: Destination IP is mapped to the destination MAC McGraw-Hill 10 ©The McGraw-Hill Companies, Inc., 2004 Example 1 A host with IP address 130.23.3.20 and physical address B23455102210 has a packet to send to another host with IP address 130.23.43.25 and physical address A46EF45983AB. The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames. Solution Figure 20.6 shows the ARP request and reply packets. Note that the ARP data field in this case is 28 bytes, and that the individual addresses do not fit in the 4-byte boundary. That is why we do not show the regular 4-byte boundaries for these addresses. Note that we use hexadecimal for every field except the IP addresses. McGraw-Hill 11 ©The McGraw-Hill Companies, Inc., 2004 Figure 20.6 Example 1 Start of Frame Delimiter -SDF McGraw-Hill 12 ©The McGraw-Hill Companies, Inc., 2004 IP Host-to-host network layer delivery protocol for the Internet. Unreliable and connectionless datagram protocol Best-effort: no error control or flow control. Has error detection mechanism to discard the packets that are corrupted. For reliability, use IP with TCP. Each datagram is delivered independently and via different routes. Datagrams: Packets of IP layer. McGraw-Hill Variable-length packet consisting of header [20 to 60 bytes] and data. 13 ©The McGraw-Hill Companies, Inc., 2004 IP datagram McGraw-Hill HLEN must be multiplied by 4 to get the length in bytes Differentiated services: QoS Total length = length of data + header length TTL: number of hops; approx 2 times the maximum number of routes between any two hosts. Protocol: Defines the higher level protocol that uses IP layer. 14 ©The McGraw-Hill Companies, Inc., 2004 Protocols: Multiplexing McGraw-Hill Value Protocol • 1 ICMP • 2 IGMP • 6 TCP • 17 UDP • 89 OSPF 15 ©The McGraw-Hill Companies, Inc., 2004 Checksum Checksum only covers the header and not data. Calculate Checksum McGraw-Hill Data checksum is handled by higher-level protocols that encapsulate the data in the IP datagram. Header changes when packets travels on the network but data does not change. Divide the IP header into 16-bit sections. Value of checksum field is set to zero. All the sections are added and the sum is complemented. The result is inserted in the checksum field. 16 ©The McGraw-Hill Companies, Inc., 2004 Example of checksum calculation McGraw-Hill 17 ©The McGraw-Hill Companies, Inc., 2004 Fragmentation Fragmentation Each router on the network decapsulates the IP datagram from the frame it receives, process it, and then encapsulates it in another frame. Format and size depends on the incoming and outgoing physical network. IP datagram must be divided to make it possible to pass through these physical networks. This is called fragmentation Maximum Transfer Unit (MTU) To make IP independent of the physical network, the maximum length of IP is equal to the largest maximum transfer unit (MTU) 65,535 bytes. McGraw-Hill 18 ©The McGraw-Hill Companies, Inc., 2004 Fragmentation Fields Identification: Same for all the fragments. Helps destination in reassembly of fragments. Flags: 3-bit field. First bit is reserved. Second bit is called Don’t fragment bit. If set, don’t fragment the packet. If set and still needs fragmentation, discard the packet and send an ICMP message to the source host. Third field is more fragment bit. If 0 means that this is the last fragment. Fragmentation offset 13-bit field shows the relative position of this fragment with respect to the whole datagram. It is the offset of the data in the original datagram measured in units of 8 bytes. Forces hosts or routers that fragment datagrams to choose the size of each fragment so that the first byte number is divisible by 8. McGraw-Hill 19 ©The McGraw-Hill Companies, Inc., 2004 Fragmentation Example McGraw-Hill If needed, the packets are fragmented. Each fragmented datagram has a header of its own. A fragmented datagram may itself be fragmented if it encounters a network with an even smaller MTU. Fragmentation is done at source or at the routers on the fly. Re-assembly is done only at the destination. 20 ©The McGraw-Hill Companies, Inc., 2004 ICMP: Internet Control Message Protocol IP lacks error control. Lacks of assistance mechanisms. No error-reporting or checking. What happens if router can not find a final destination? What if time-to-live filed has zero value? What will happen if final destination has not received all the fragments within a pre-determined time limit? A host sometimes needs to determine if a router or another host is alive. And sometimes a network manager needs information from another host or router. ICMP (Internet Control Message Protocol) is a network layer protocol. ICMP Messages are encapsulated inside IP datagrams before going to the lower layer. Protocol field in IP header is 1 for ICMP. McGraw-Hill 21 ©The McGraw-Hill Companies, Inc., 2004 ICMP Encapsulation McGraw-Hill 22 ©The McGraw-Hill Companies, Inc., 2004 Types of ICMP Messages 1. Error-Reporting Messages 2. Query Messages Error-Reporting Messages: Chance of error always exists and ICMP handles error reporting Error reporting messages are always sent to the original source. ICMP uses the source IP address to send the error message to the source (originator) of the datagram. McGraw-Hill 23 ©The McGraw-Hill Companies, Inc., 2004 Error-Reporting Messages McGraw-Hill 24 ©The McGraw-Hill Companies, Inc., 2004 Error-Reporting Messages Destination unreachable Router can not route a datagram or a host cannot deliver a datagram, the datagram is discard and message sent to the source. Source Quench IP is connectionless protocol and so no control of flow or congestion. Source has no idea whether the destination host has been overwhelmed with datagrams. When a router or host discards a datagram due to congestion, it sends a source-quench message to the sender of the datagram. McGraw-Hill To inform sender about the loss of the datagram To warn the source that there is congestion in the path and that the source should slow down the sending process. 25 ©The McGraw-Hill Companies, Inc., 2004 Error-Reporting Messages Time-exceeded: Generated in two cases Parameter Problem When a router receives a datagram with TTL as 0, then the router discards the datagram and sends a message to the source. When all fragments that make up a message do not arrive at the destination host within a certain time limit. If a router or the destination host discovers an ambiguous or missing value in any field of the datagram, it discards the the datagram and sends a message back to the source. Redirection McGraw-Hill Routing decision on routers is made using routing protocols but in the case of hosts, there is no routing protocol. A host may send a datagram, which is destined for another network, to the wrong router. In this case, the router that receives the datagram will forward the datagram to the correct router. However, to update the routing table of a host, it sends a redirection message back to this host. 26 ©The McGraw-Hill Companies, Inc., 2004 Query Messages In the case of query message, a node sends a message that is answered in a specific format by the destination node. Echo request and reply: for diagnostic purposes Time-stamp request and reply: to determine the round trip time and also to synchronize the clocks in two machines. Address mask request and reply: Request by a host to know its subnet mask to the router. Router solicitation and advertisement: Solicitation is request by host to know the route to send a packet. Reply comes from the router as advertisement. McGraw-Hill 27 ©The McGraw-Hill Companies, Inc., 2004 IPv6 IPv4 Two level address structure. Inefficient. For real-time audio and video transmission, there is no minimum delay strategies and reservation of resources. No security mechanism [encryption and authentication of data]. IPv6 [IPng: IP next generation] McGraw-Hill Larger address space: 128 bits long. Better header format: Options are separated from base header. This simplifies and speeds up the routing process because most of the options do not need to be checked by routers. 28 ©The McGraw-Hill Companies, Inc., 2004 IPv6 IPv6 [IPng: IP next generation] McGraw-Hill New options: For additional functionalities. Allowance for extension Support for resource reservation: Type-of-service has been removed but a mechanism called flow label has been added to enable the source to request special handling of the packet. This mechanism can be used to support traffic such as real-time audio and video. Support for more security: encryption and authentication options in IPv6 provide confidentiality and integrity of the packet. 29 ©The McGraw-Hill Companies, Inc., 2004 IPv6 Address Hexadecimal colon notation Abbreviation McGraw-Hill Divided into 8 sections, each 2 bytes in length Two bytes in hexadecimal requires four hexadecimal digits. Leading zeros of a section (four digits between two colons) can be omitted. Only the leading zeros can be dropped, not the trailing zeros. 30 ©The McGraw-Hill Companies, Inc., 2004 Abbreviated Address Abbreviations are possible if there are consecutive sections consisting of zeros only. We can remove the zeros altogether and replace them with a double semicolon. But only once per address. McGraw-Hill 31 ©The McGraw-Hill Companies, Inc., 2004 CIDR Address IPv6 allows classless addressing and CIDR notation. Categories of addresses McGraw-Hill Unicast: Single computer. Anycast: A group of computers with addresses that have the same prefix. All computers connected to the same physical network share the same prefix address. A packet sent to an anycast address must be delivered to exactly one of the members of the group. Multicast: Group of computers that may or may not share the same prefix and may or may not be connected to the same physical network. A packet sent to a multicast address must be delivered to each member of the set. 32 ©The McGraw-Hill Companies, Inc., 2004 Format of an IPv6 Datagram McGraw-Hill 33 ©The McGraw-Hill Companies, Inc., 2004 Format of an IPv6 Datagram Base header: 40 bytes; Data + extension header= 65535 bytes Ver: 4 bit; Priority: 4 bit Flow label: 24 bit; Payload length: length of IP datagram excluding the base header. Next header: 8-bit field defining the header that follows the base header in the datagram. Sometimes, the pointer points to the upper-layer protocol’s header. Hop limit: TTL. Source / Destination Address: 16-bytes (128 bit). IP Add. Fragmentation in IPv6 is possible only at the source. Source must find the MTU using MTU discovery technique. OR MTU=576 bytes (smallest possible size) McGraw-Hill 34 ©The McGraw-Hill Companies, Inc., 2004 Comparison of Network Layers in v4 and v6 McGraw-Hill ICMPv6 is designed for IPv6 Some protocols that were independent in version 4 are now part of ICMPv6. ARP and IGMP in version 4 are combined in ICMPv6. RARP is dropped from the suite because it is seldom used. 35 ©The McGraw-Hill Companies, Inc., 2004 IP Transition Strategies Dual Stack: station should run IPv4 and IPv6 simultaneously until all the Internet uses IPv6. (Host DNS Query) Tunneling: A strategy used when two computers using IPv6 want to communicate with each other when the packet must pass through a region that uses IPv4. To pass this region, IPv4 address is needed. IPv6 packet is encapsulated in an IPv4 packet when it enters the region, and the IPv6 packet leaves its capsule when it exits the region. McGraw-Hill 36 ©The McGraw-Hill Companies, Inc., 2004 Dual Stack and Tunneling McGraw-Hill 37 ©The McGraw-Hill Companies, Inc., 2004 Header Translation When the majority of the Internet has moved to IPv6 but some systems still use IPv4. Sender wants to use IPv6, but the receiver does not understand IPv6. Tunneling does not work in this situation because the packet must be in the IPv4 format to be understood by the receiver. In this case, the header format must be changed totally through header translation. McGraw-Hill 38 ©The McGraw-Hill Companies, Inc., 2004