Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spring 20071 Routing & Switching Umar Kalim Dept. of Communication Systems Engineering 03/04/2007.

Similar presentations


Presentation on theme: "Spring 20071 Routing & Switching Umar Kalim Dept. of Communication Systems Engineering 03/04/2007."— Presentation transcript:

1 Spring 20071 Routing & Switching Umar Kalim Dept. of Communication Systems Engineering umar.kalim@niit.edu.pk http://www.niit.edu.pk/~umarkalim 03/04/2007

2 Spring 20072 Outline ARP, RARP ICMP

3 Spring 20073 Logical vs Physical addresses Internetwork addresses –Jurisdiction is universal –IP addresses  All networks understand the addressing scheme –Implemented in software Physical addresses –Jurisdiction is local –Implemented in hardware –Depends on the technology used at the physical layer (and hence the protocols at MAC layer)

4 Spring 20074 A packet using one logical addressing scheme may pass through networks with different physical layer technologies Thus we need to consider two different and independent addressing schemes; logical and physical

5 Spring 20075 Problem Whenever a host needs to send a message to another host, it has the IP address. However the IP datagram must be encapsulated in a frame (by the MAC layer) so that it may be delivered over the physical layer Hence the need for the physical address The only way to get the physical address is to have a mapping scheme

6 Spring 20076 Static mapping Create a table that associates a logical address with a physical address

7 Spring 20077 Static mapping Assumptions –Each machine knows the IP of the destination machine –In case the machine address is not known, it can be looked up in the table

8 Spring 20078 Drawbacks of static mapping A machine could change its NIC –Hence a new physical address In some physical & data link layer protocols, the machine addresses changes whenever a machine is turned on A mobile computer can move from one network to another –Hence a change in the physical address (depending upon the underline protocols)

9 Spring 20079 Solution The static mapping table must be updated periodically or whenever the need arises

10 Spring 200710 Dynamic mapping Each time the machine knows one of the two addresses (physical or logical) it can obtain the other

11 Spring 200711 ARP & RARP Protocols defined for the dynamic mapping of logical and physical addresses

12 Spring 200712 ARP & RARP ARP: Address Resolution Protocol RARP: Reverse Address Resolution Protocol Use unicast and broadcast physical addresses Position of ARP & RARP in the TCP/IP stack

13 Spring 200713 ARP Instead of maintaining a static table, we can obtain the physical address at runtime –This is where ARP comes in ARP associates an IP address with a physical address On a typical network, each interface is identified by a physical address

14 Spring 200714 ARP Anytime a host needs to find the physical address, it send an ARP query The datagram contains the IP and the physical address of the sender as well as the IP address of the intended recipient Since the sender does not knows the destinations physical address, the datagram is broadcasted over the network

15 Spring 200715 ARP Every host receives the query However only the intended recipient finds its IP address in the query message and responds This response is sent as a unicast

16 Spring 200716 ARP

17 Spring 200717 ARP packet format 16-bits: type of network e.g. Ethernet 1 16-bits: protocol e.g. IPv4 0800 16 8-bits: length of physical address e.g. Ethernet 6 8-bits: length of logical address e.g. IPv4 4 Variable length field

18 Spring 200718 Encapsulation ARP packet is encapsulated into a data-link frame Ethernet frame

19 Spring 200719 Steps 1.Sender knows the IP of the destination 2.IP asks ARP to create a request 3.Message is passed to the data-link layer and after encapsulation, the frame is transmitted 4.Every host receives the frame and pass it to ARP as the “type” field has the ARP code. All machines drop the packet, since the IP of the intended recipient do not match with their IP

20 Spring 200720 Steps … 5.The host then replies with another ARP message (response) that contains the physical address. This response is transmitted as a unicast message. 6.The sender receives the reply 7.The sender then compiles and transmits the required datagrams using the physical address

21 Spring 200721 Four cases

22 Spring 200722 A host with IP address 130.23.43.20 and physical address B2:34:55:10:22:10 has a packet to send to another host with IP address 130.23.43.25 and physical address A4:6E:F4:59:83:AB (which is unknown to the first host). The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames. Example 1 See Next Slide

23 Spring 200723 Solution 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. Also note that the IP addresses are shown in hexadecimal. For information on binary or hexadecimal notation see Appendix B. Example 1 (Continued) See Next Slide

24 Spring 200724

25 Spring 200725 Proxy ARP Proxy ARP is used to create subnetting effect Proxy ARP: An ARP that acts on behalf of a set of hosts –Whenever a router receives an ARP request which asks for the physical address of any one of the hosts it is representing, the router responds with its own physical address

26 Spring 200726 Proxy ARP

27 Spring 200727 ARP’s Hypothetical Implementation The software package would include five modules: –Cache table –Queues –The output module –The input module and a –Cache control module

28 Spring 200728

29 Spring 200729 Cache table Usually one or more IP datagrams to send to the same destination –Inefficient to use ARP for every datagram –Thus the need of a cache table Limited space –Hence the mappings are not stored indefinitely –The result is an up-to-date cache table

30 Spring 200730 Cache table FREE, PENDING and RESOLVED Hardware type, Protocol type, hardware length, protocol length, interface number

31 Spring 200731 Queues, Output and Input Modules Queues; one for each destination –To hold the IP packets while ARP tries to resolve the hardware address The output module send unresolved packets into the corresponding queue The input module removes a packet from a queue and sends it –with the resolved physical address –to the data link layer for transmission

32 Spring 200732 Output Modules Waits for an IP packet from the network layer Checks the cache table to find an entry –The destination IP address must match the protocol address If RESOLVED => data-link layer If PENDING => wait till the address is found If none exists => create a queue and enqueue the packet

33 Spring 200733 The ARP output module receives an IP datagram (from the IP layer) with the destination address 114.5.7.89. It checks the cache table and finds that an entry exists for this destination with the RESOLVED state (R in the table). It extracts the hardware address, which is 457342ACAE32, and sends the packet and the address to the data link layer for transmission. The cache table remains the same. Example

34 Spring 200734 Cache table

35 Spring 200735 Twenty seconds later, the ARP output module receives an IP datagram (from the IP layer) with the destination address 116.1.7.22. It checks the cache table and does not find this destination in the table. The module adds an entry to the table with the state PENDING and the Attempt value 1. It creates a new queue for this destination and enqueues the packet. It then sends an ARP request to the data link layer for this destination. The new cache table is shown in Table 7.2. Example See Next Slide

36 Spring 200736 Updated cache table for Example

37 Spring 200737 Input Modules Wait untill request/reply arrives If the entry exists & PENDING => updates the entry as per the reply and change to RESOLVED, sets the timeout, delivers the packets If the entry exists & RESOLVED => updates the entry as per the reply, resets the timeout If no entry exists => creates an entry, state is set to RESOLVED and timeout is set

38 Spring 200738 Cache control module Responsible for maintaining the cache table Periodically checks each entry If FREE, it moves on to the next If PENDING, increments the attempts field by one –If greater than max, state => FREE, queue destroyed If RESOLVED, decrements the timeout –If FREE, queue destroyed

39 Spring 200739 Fifteen seconds later, the ARP input module receives an ARP packet with target protocol (IP) address 188.11.8.71. The module checks the table and finds this address. It changes the state of the entry to RESOLVED and sets the time-out value to 900. The module then adds the target hardware address (E34573242ACA) to the entry. Now it accesses queue 18 and sends all the packets in this queue, one by one, to the data link layer. The new cache table is shown in Table 7.3. Example See Next Slide

40 Spring 200740 Updated cache table for Example

41 Spring 200741 Twenty-five seconds later, the cache-control module updates every entry. The time-out values for the first three resolved entries are decremented by 60. The time-out value for the last resolved entry is decremented by 25. The state of the next-to-the last entry is changed to FREE because the time-out is zero. For each of the three pending entries, the value of the attempts Example See Next Slide

42 Spring 200742 Updated cache table for Example

43 Spring 200743 RARP Reverse Address Resolution Protocol

44 Spring 200744 RARP Finds the logical address for a machine that only knows its physical address –Logical addresses are unique and independent of the physical address Diskless machines have ROM (and an RARP client) –Broadcast the RARP request –Machine with all the IP addresses replies (RARP server) - unicast

45 Spring 200745 Packet Format

46 Spring 200746 RARP

47 Spring 200747 Encapsulation

48 Spring 200748 Alternates to RARP BOOTP DHCP

49 Spring 200749 ICMP

50 Spring 200750 Why ICMP? IP provides connectionless & unreliable (best- effort) datagram delivery IP has deficiencies –Lack of error control/correction  What if something goes wrong? –Router drops a packet, how to know? –TTL is decremented by one at each hop, how will the source know that TTL has reached 0 –Lack of host and management queries  Host is alive or not? Misc information is required, how to fetch?

51 Spring 200751 ICMP w.ref.t Network layer Supporting protocol for IP –As is ARP and RARP –ICMP is shown above, since ICMP datagrams are not sent to the data-link layer directly. They are encapsulated in IP datagrams and then forwarded

52 Spring 200752 ICMP Encapsulation IPheader.protocol = 1

53 Spring 200753 Types of ICMP Messages Errors which a router or a host (destination) may encounter Query messages to get specific information from a router or a host. Always occur in pairs

54 Spring 200754 ICMP Messages

55 Spring 200755 Message Format An ICMP message has an 8-byte header and a variable-size data section An ICMP message has an 8-byte header and a variable-size data section The general format of the header is different for each message type yet the first 4 bytes are common to all The general format of the header is different for each message type yet the first 4 bytes are common to all

56 Spring 200756 Error Messages

57 Spring 200757 Error Reporting vs Error Correction ICMP does not –Provide interaction between a router and the source of trouble –Maintain state information (each packet is handled independently) When a datagram causes an error, ICMP can only report the error condition back to the original source of the datagram

58 Spring 200758 ICMP always reports error messages to the original source. Note: Error Reporting

59 Spring 200759 The following are important points about ICMP error messages: ❏ No ICMP error message will be generated in response to a datagram carrying an ICMP error message. ❏ No ICMP error message will be generated for a fragmented datagram that is not the first fragment. ❏ No ICMP error message will be generated for a datagram having a multicast address. ❏ No ICMP error message will be generated for a datagram having a special address such as 127.0.0.0 or 0.0.0.0. Note:

60 Spring 200760 Error Messages

61 Spring 200761 Destination unreachable ~ 3 Generated by the router to inform the client that the destination host is unreachable Reasons for this message may include the –physical connection to the host does not exist (distance is infinite), –the indicated protocol or port is not active, or –the data must be fragmented but the 'don't fragment' flag is on http://en.wikipedia.org/wiki/ICMP_Destination_Unreachabl e

62 Spring 200762 Destination unreachable ~ 3 Defined codes for each type of failure –Refer to the book for the values

63 Spring 200763 Source Quench ~ 4 Message which requests the sender to decrease the traffic rate of messages to a router or host Generated if the router or host does not have sufficient buffer space to process the request, or may occur if the router or host's buffer is approaching its limit http://en.wikipedia.org/wiki/ICMP_Source_Quench

64 Spring 200764 Source Quench ~ 4 No mechanism for Flow-control in IP A source-quench message informs the source that a datagram has been discarded due to congestion in a router or the destination host The source must slow down the sending of datagrams until the congestion is relieved One source-quench message is sent for each datagram that is discarded due to congestion

65 Spring 200765 Time exceeded ~ 11 Generated by a gateway to inform the source of a datagram that the datagram has been discarded due to the time to live field reaching zero message may also be sent by a host if it fails to reassemble a fragmented datagram http://en.wikipedia.org/wiki/ICMP_Time_Exceeded

66 Spring 200766 Parameter Problem ~ 12 Sent to the source host for any problem not specifically covered by another ICMP message –0 ~ ambiguous –1 ~ missing option field

67 Spring 200767 Redirection ~ 5 http://www.tcpipguide.com/free/t_ICMPv4RedirectMessages.htm

68 Spring 200768 Redirection ~ 5

69 Spring 200769 Questions? That’s all for today!


Download ppt "Spring 20071 Routing & Switching Umar Kalim Dept. of Communication Systems Engineering 03/04/2007."

Similar presentations


Ads by Google