icmp: internet control message protocol

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

Upload: eros

Post on 05-Jan-2016

51 views

Category:

Documents


3 download

DESCRIPTION

used by hosts, routers, gateways to communication network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer “above” IP: ICMP msgs carried in IP datagrams - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ICMP: Internet Control Message Protocol

ICMP: Internet Control Message Protocol

• used by hosts, routers, gateways to communication network-level information– error reporting:

unreachable host, network, port, protocol

– echo request/reply (used by ping)

• network-layer “above” IP:– ICMP msgs carried in IP

datagrams• ICMP message: type, code

plus first 8 bytes of IP datagram causing error

Type Code description0 0 echo reply (ping)3 0 dest. network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header

Page 2: ICMP: Internet Control Message Protocol

DHCP: Dynamic Host Configuration Protocol

Goal: allow host to dynamically obtain its IP address from network server when it joins networkCan 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

Page 3: ICMP: Internet Control Message Protocol

DHCP client-server scenario

223.1.1.1

223.1.1.2

223.1.1.3

223.1.1.4 223.1.2.9

223.1.2.2

223.1.2.1

223.1.3.2223.1.3.1

223.1.3.27

A

BE

DHCP server

arriving DHCP client needsaddress in thisnetwork

Page 4: ICMP: Internet Control Message Protocol

DHCP client-server scenarioDHCP server: 223.1.2.5 arriving

client

time

DHCP discover

src : 0.0.0.0, 68 dest.: 255.255.255.255,67yiaddr: 0.0.0.0transaction ID: 654

DHCP offer

src: 223.1.2.5, 67 dest: 255.255.255.255, 68yiaddrr: 223.1.2.4transaction ID: 654Lifetime: 3600 secs

DHCP request

src: 0.0.0.0, 68 dest:: 255.255.255.255, 67yiaddrr: 223.1.2.4transaction ID: 655Lifetime: 3600 secs

DHCP ACK

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

Page 5: ICMP: Internet Control Message Protocol

What is mobility?

• spectrum of mobility, from the network perspective:

no mobility high mobility

mobile user, usingsame access point

mobile user, passing through multiple access point while maintaining ongoing connections (like cell phone)

mobile user, connecting/ disconnecting from network using DHCP.

Page 6: ICMP: Internet Control Message Protocol

Mobility: Vocabularyhome network: permanent “home” of mobile(e.g., 128.119.40/24)

Permanent address: address in home network, can always be used to reach mobilee.g., 128.119.40.186

home agent: entity that will perform mobility functions on behalf of mobile, when mobile is remote

wide area network

correspondent

Page 7: ICMP: Internet Control Message Protocol

Mobility: more vocabulary

Care-of-address: address in visited network.(e.g., 79,129.13.2)

wide area network

visited network: network in which mobile currently resides (e.g., 79.129.13/24)

Permanent address: remains constant (e.g., 128.119.40.186)

home agent: entity in visited network that performs mobility functions on behalf of mobile.

correspondent: wants to communicate with mobile

Page 8: ICMP: Internet Control Message Protocol

How do you contact a mobile friend:

• search all phone books?

• call her parents?• expect her to let you

know where he/she is?

I wonder where Alice moved to?

Consider friend frequently changing addresses, how do you find her?

Page 9: ICMP: Internet Control Message Protocol

Mobility: approaches

• Let routing handle it: routers advertise permanent address of mobile-nodes-in-residence via usual routing table exchange.– routing tables indicate where each mobile located– no changes to end-systems

• Let end-systems handle it: – indirect routing: communication from correspondent

to mobile goes through home agent, then forwarded to remote

– direct routing: correspondent gets foreign address of mobile, sends directly to mobile

Page 10: ICMP: Internet Control Message Protocol

Mobility: approaches

• Let routing handle it: routers advertise permanent address of mobile-nodes-in-residence via usual routing table exchange.– routing tables indicate where each mobile located– no changes to end-systems

• let end-systems handle it: – indirect routing: communication from correspondent

to mobile goes through home agent, then forwarded to remote

– direct routing: correspondent gets foreign address of mobile, sends directly to mobile

not scalable

to millions of mobiles

Page 11: ICMP: Internet Control Message Protocol

Mobility: registration

End result:• Foreign agent knows about mobile• Home agent knows location of mobile

wide area network

home network

visited network

1

mobile contacts foreign agent on entering visited network

2

foreign agent contacts home agent home: “this mobile is resident in my network”

Page 12: ICMP: Internet Control Message Protocol

Mobility via Indirect Routing

wide area network

homenetwork

visitednetwork

3

2

41

correspondent addresses packets using home address of mobile

home agent intercepts packets, forwards to foreign agent

foreign agent receives packets, forwards to mobile

mobile replies directly to correspondent

Page 13: ICMP: Internet Control Message Protocol

Indirect Routing: comments• Mobile uses two addresses:

– permanent address: used by correspondent (hence mobile location is transparent to correspondent)

– care-of-address: used by home agent to forward datagrams to mobile

• foreign agent functions may be done by mobile itself• triangle routing: correspondent-home-network-mobile

– inefficient when

correspondent, mobile

are in same network

Page 14: ICMP: Internet Control Message Protocol

Forwarding datagrams to remote mobile

Permanent address: 128.119.40.186

Care-of address: 79.129.13.2

dest: 128.119.40.186

packet sent by correspondent

dest: 79.129.13.2 dest: 128.119.40.186

packet sent by home agent to foreign agent: a packet within a packet

dest: 128.119.40.186

foreign-agent-to-mobile packet

Page 15: ICMP: Internet Control Message Protocol

Indirect Routing: moving between networks

• suppose mobile user moves to another network– registers with new foreign agent– new foreign agent registers with home agent– home agent update care-of-address for mobile– packets continue to be forwarded to mobile (but

with new care-of-address)

• Mobility, changing foreign networks transparent: on going connections can be maintained!

Page 16: ICMP: Internet Control Message Protocol

Mobility via Direct Routing

wide area network

homenetwork

visitednetwork

4

2

41correspondent requests, receives foreign address of mobile

correspondent forwards to foreign agent

foreign agent receives packets, forwards to mobile

mobile replies directly to correspondent

3

Page 17: ICMP: Internet Control Message Protocol

Mobility via Direct Routing: comments

• overcome triangle routing problem

• non-transparent to correspondent: correspondent must get care-of-address from home agent– What happens if mobile changes networks?

Page 18: ICMP: Internet Control Message Protocol

Mobile IP

• RFC 3220

• has many features we’ve seen: – home agents, foreign agents, foreign-agent

registration, care-of-addresses, encapsulation (packet-within-a-packet)

• three components to standard:– agent discovery– registration with home agent– indirect routing of datagrams

Page 19: ICMP: Internet Control Message Protocol

Mobile IP: agent discovery• agent advertisement: foreign/home agents

advertise service by broadcasting ICMP messages (typefield = 9)

RBHFMGV bits reserved

type = 16

type = 9 code = 0 = 9

checksum = 9

router address

standard ICMP fields

mobility agent advertisement

extension

length sequence #

registration lifetime

0 or more care-of-addresses

0 8 16 24

R bit: registration required

H,F bits: home and/or foreign agent

Page 20: ICMP: Internet Control Message Protocol

Mobile IP: registration example

visited network: 79.129.13/ 24 home agent

HA: 128.119.40.7 f oreign agent

COA: 79.129.13.2 COA: 79.129.13.2

….

I CMP agent adv. Mobile agent MA: 128.119.40.186

registration req.

COA: 79.129.13.2 HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 9999 identification:714 ….

registration req.

COA: 79.129.13.2 HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 9999 identification: 714 encapsulation format ….

registration reply

HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 4999 Identification: 714 encapsulation format ….

registration reply

HA: 128.119.40.7 MA: 128.119.40.186 Lifetime: 4999 Identification: 714 ….

time