ccnet-lec-12-arp-dhcp-icmp

Upload: suleman-jamil

Post on 08-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    1/17

    Lecture

    12Data Communication & Networks

    ARP, DHCP & ICMP

    Muhammad Yousaf

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    2/17

    [email protected] 2

    Address Resolution Protocol: (ARP)

    Routers forward packets on the basis of IPaddress, layer-3

    But actual transmission takes place via NetworkInterface Card (NIC), layer-2

    And layer-2 transmission uses MAC addresses

    How nodes come to know MAC address of othernodes?

    We need a mechanism that can:Translate IP addresses into MAC addresses

    That mechanism is ARP

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    3/17

    [email protected] 3

    ARP procedure:

    Source: http://technet.microsoft.com/en-us/library/bb726993.aspx (25-11-2010)

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    4/17

    [email protected] 4

    ARP procedure: cont

    ARP is defined in RFC-826Initially node broadcasts ARP request message

    Saying who has following IP address

    All nodes receive this request messageNode with particular IP address responds with ARPreply

    ARP reply contains MAC address corresponding to

    the IP address

    Requesting node saves this IP-to-MAC addressmapping in its ARP-cache

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    5/17

    [email protected] 5

    ARP command:

    C:\case>arp -a

    Internet Address Physical Address Type

    157.55.85.212 00-aa-00-62-c6-09 static

    172.16.3.153 00-16-6f-52-f3-8b static

    172.16.8.101 f0-0d-ee-00-a0-0b static

    172.16.8.25 00-20-af-b4-a1-4e dynamic

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    6/17

    [email protected] 6

    DHCP:

    Dynamic Host Configuration Protocol (DHCP)Unlike MAC addresses, IP addresses are not fix

    When a new host is added in network, how aunique IP address may be assigned to it?

    There are two approaches:

    Manually

    Administrator manually assigns IP address

    An error-prone method for large networks

    Dynamically

    Automatically assigns IP addresses to the client nodes

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    7/17

    [email protected] 7

    DHCP: cont

    DHCP is specified in RFC-1541For automatic address assignment in network thereshould be a DHCP server running DHCP service

    Administrator configures DHCP server with a poolof IP addresses

    These addresses are leased out to client nodes onrequest

    The process of dynamically obtaining IP addressfrom DHCP server consists of 4-steps

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    8/17

    [email protected] 8

    Basic DHCP Model:

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    9/17

    [email protected] 9

    DHCP - obtaining IP addresses:

    Source: http://technet.microsoft.com/en-us/library/bb727003.aspx (25-11-2010)

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    10/17

    [email protected] 10

    DHCP: cont

    Server Discovery:Client broadcasts DHCP Discover Packetto discover DHCP serverClient puts its MAC address in packet and asks for the IP address

    IP Address Offer:

    DHCP server replies as DHCP Offer Packetwith a tentative IPaddress along with lease time

    IP Address Request:

    If client accepts offered IP address then it formally sends a DHCP

    Request Packet

    Acknowledgement:Server acknowledges address assignment with ACK Packet

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    11/17

    [email protected] 11

    DHCP relay agent:

    If DHCP server is on some other network then, wecan use a DHCP relay agent

    Relay agent just receives the broadcasted DHCPbroadcasts and forwards them to the DHCP server

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    12/17

    [email protected] 12

    DHCP relay agent:

    Source: http://technet.microsoft.com/en-us/library/bb727003.aspx (25-11-2010)

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    13/17

    [email protected] 13

    ICMP:

    ICMP = Internet Control Message ProtocolA protocol to convey control information amonghosts and routers in internet

    Can send control messages to remote nodes

    Can test remote nodes whether they are alive ornot

    (using Ping command)

    Can report error messages from remote nodes

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    14/17

    [email protected] 14

    ICMP messages:

    Following are some of the ICMP messages:Echo request

    Echo reply

    Destination unreachable

    Redirect messageTTL exceeded

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    15/17

    [email protected] 15

    ICMP in Windows XP:

    Control Panel >>Windows Firewalls >>Advanced Tab >>ICMP -> Settings

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    16/17

    [email protected] 16

    Ping command:

    C:\case> ping 192.168.55.1

    Pinging 192.168.55.1 with 64 bytes of data:

    64 bytes from 192.168.55.1: icmp_seq=0 ttl=30 time=1.164 ms

    64 bytes from 192.168.55.1: icmp_seq=1 ttl=30 time=0.918 ms

    - 192.168.55.1 ping statistics -

    7 packets transmitted, 7 packets received, 0% packet loss

    C:\case>ping 172.16.3.100

    Pinging 172.16.3.100 with 32 bytes of data:

    Destination host unreachable.Destination host unreachable.

    Ping statistics for 172.16.3.100:

    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

  • 8/6/2019 ccnet-lec-12-ARP-DHCP-ICMP

    17/17

    [email protected] 17

    Questions ???