Sei sulla pagina 1di 6

ICMP +DHCP

ICMP: Internet Control Message Protocol

• used by hosts & routers to


communicate network-level Type Code description
information 0 0 echo reply (ping)
3 0 dest. network unreachable
– error reporting: unreachable
3 1 dest host unreachable
host, network, port, protocol
3 2 dest protocol unreachable
– echo request/reply (used by 3 3 dest port unreachable
ping) 3 6 dest network unknown
• network-layer “above” IP: 3 7 dest host unknown
– ICMP msgs carried in IP 4 0 source quench (congestion
datagrams control - not used)
• ICMP message: type, code plus first 8 8 0 echo request (ping)
bytes of IP datagram causing error 9 0 route advertisement
10 0 router discovery
11 0 TTL expired
12 0 bad IP header

Network Layer 4-2


Traceroute and ICMP
• Source sends series of UDP • When ICMP message arrives,
segments to dest source calculates RTT
– First has TTL =1 • Traceroute does this 3 times
– Second has TTL=2, etc. Stopping criterion
– Unlikely port number • UDP segment eventually arrives
• When nth datagram arrives to nth at destination host
router: • Destination returns ICMP “host
– Router discards datagram unreachable” packet (type 3,
– And sends to source an ICMP code 3)
message (type 11, code 0)
• When source gets this ICMP,
– Message includes name of
stops.
router& IP address

Network Layer 4-3


DHCP: Dynamic Host Configuration Protocol

Goal: allow host to dynamically obtain its IP address from


network server when it joins network
Can renew its lease on address in use
Allows reuse of addresses (only hold address while connected an “on”
Support for mobile users who want to join network (more shortly)
DHCP overview:
– host broadcasts “DHCP discover” msg
– DHCP server responds with “DHCP offer” msg
– host requests IP address: “DHCP request” msg
– DHCP server sends address: “DHCP ack” msg
5: DataLink Layer 5-4
DHCP client-server scenario

A DHCP 223.1.2.1
223.1.1.1
server
223.1.1.2
223.1.1.4 223.1.2.9
B
223.1.2.2 arriving DHCP
223.1.1.3 223.1.3.27 E client needs
address in this
223.1.3.1 223.1.3.2
network

5: DataLink Layer 5-5


DHCP client-server scenario
DHCP server: 223.1.2.5 arriving
DHCP discover
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654

DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
time Lifetime: 3600 secs

DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs

5: DataLink Layer 5-6

Potrebbero piacerti anche