Sie sind auf Seite 1von 17

Lecture

Data Communication & Networks 12


ARP, DHCP & ICMP

Muhammad Yousaf
Address Resolution Protocol: (ARP)
Routers forward packets on the basis of IP
address, layer-3
But actual transmission takes place via Network
Interface Card (NIC), layer-2
And layer-2 transmission uses MAC addresses
How nodes come to know MAC address of other
nodes?
We need a mechanism that can:
Translate IP addresses into MAC addresses
That mechanism is ARP

myousaf@ymail.com 2
ARP procedure:

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


ARP procedure: cont…
ARP is defined in RFC-826
Initially node broadcasts ARP request message
Saying who has following IP address
All nodes receive this request message
Node with particular IP address responds with ARP
reply
ARP reply contains MAC address corresponding to
the IP address
Requesting node saves this IP-to-MAC address
mapping in its ARP-cache
myousaf@ymail.com 4
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

myousaf@ymail.com 5
DHCP:
Dynamic Host Configuration Protocol (DHCP)
Unlike MAC addresses, IP addresses are not fix
When a new host is added in network, how a
unique 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

myousaf@ymail.com 6
DHCP: cont…
DHCP is specified in RFC-1541
For automatic address assignment in network there
should be a DHCP server running DHCP service
Administrator configures DHCP server with a pool
of IP addresses
These addresses are leased out to client nodes on
request
The process of dynamically obtaining IP address
from DHCP server consists of 4-steps

myousaf@ymail.com 7
Basic DHCP Model:

myousaf@ymail.com 8
DHCP - obtaining IP addresses:

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


DHCP: cont…
Server Discovery:
Client broadcasts DHCP Discover Packet to discover DHCP server
Client puts its MAC address in packet and asks for the IP address
IP Address Offer:
DHCP server replies as DHCP Offer Packet with a tentative IP
address 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

myousaf@ymail.com 10
DHCP relay agent:
If DHCP server is on some other network then, we
can use a DHCP relay agent
Relay agent just receives the broadcasted DHCP
broadcasts and forwards them to the DHCP server

myousaf@ymail.com 11
DHCP relay agent:

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


ICMP:
ICMP = Internet Control Message Protocol
A protocol to convey control information among
hosts and routers in internet
Can send control messages to remote nodes
Can test remote nodes whether they are alive or
not
(using Ping command)
Can report error messages from remote nodes

myousaf@ymail.com 13
ICMP messages:
Following are some of the ICMP messages:
Echo request
Echo reply
Destination unreachable
Redirect message
TTL exceeded

myousaf@ymail.com 14
ICMP in Windows XP:

Control Panel >>


Windows Firewalls >>
Advanced Tab >>
ICMP -> Settings <<

myousaf@ymail.com 15
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),
myousaf@ymail.com 16
Questions ???

myousaf@ymail.com 17

Das könnte Ihnen auch gefallen