Download presentation
Presentation is loading. Please wait.
Published byHarold Carson Modified over 9 years ago
1
Björn Landfeldt School of Information Technologies NETS 3303 ICMP and applications
2
Björn Landfeldt School of Information Technologies Outcome Learn about role of ICMP Protocol specifics Know about applications that use ICMP
3
Björn Landfeldt School of Information Technologies Outline intro –encapsulation/stack position –basic ideas –header format message types redirects ping Traceroute IP Mobility intro
4
Björn Landfeldt School of Information Technologies Encapsulation ICMP transmitted within IP datagram so that it is routeable (unlike arp)
5
Björn Landfeldt School of Information Technologies Protocols
6
Björn Landfeldt School of Information Technologies ICMP Idea considered part of IP functionality includes: –error messages (ttl exceeded, destination unreachable, router is out of memory, can’t fragment packet) –network management (ping/traceroute) –end host configuration (router advert, netmask) error messages go from router/end host to original ip src, not between intermediate hops –don’t know route
7
Björn Landfeldt School of Information Technologies ICMP Ideas error messages typically sent at IP layer, received by sending IP/UDP/TCP, latter may forward to application ICMP error messages never generated due to: –ICMP error message (loop) –broadcasts/multicasts Why? prevent broadcast storms error contains offending IP header + 1st 8 bytes of IP data (note tcp/udp ports)
8
Björn Landfeldt School of Information Technologies Header checksum covers icmp header/data, not ip header
9
Björn Landfeldt School of Information Technologies ICMP requests (not all)
10
Björn Landfeldt School of Information Technologies continued
11
Björn Landfeldt School of Information Technologies ICMP redirect limited dynamic routing technique only done on same link situation: –1. assume dumb host with 1 default routing table entry –2. two routers on same link, one is default, one is route to net X –3. dumb host sends pkt to net X via default router –4. default router sends ICMP redirect with correct router address to dumb host
12
Björn Landfeldt School of Information Technologies Redirect contd. note: router detects redirect because it discovers that packet is being forwarded back out input i/f default router also forwards original packet correctly dumb host changes its routing table to reflect newly learned route to other net route added is HOST route in BSD system because we lack subnet mask knowledge
13
Björn Landfeldt School of Information Technologies Picture
14
Björn Landfeldt School of Information Technologies Dest unreachable Host or router cannot deliver a datagram Return IP header first 8 bytes Codes –0 Network unreachable –1 Host unreachable –2 Protocol unreachable –3 Protocol unreachable –Etc.
15
Björn Landfeldt School of Information Technologies Source Quench No flow control in IP (data rate) Source quench alerts sender of –A packet was discarded –Slow down transmission rate Returned is IP header plus 8 bytes of data
16
Björn Landfeldt School of Information Technologies TTL Exceeded If TTL value 0, discard packet and issue ICMP time exceeded, code 0 If fragments not received within a certain time limit, discard fragments and issue ICMP time exceeded, code 1
17
Björn Landfeldt School of Information Technologies Parameter problem If the IP header format wrong –Issue ICMP parameter problem Code 0 faulty header field, pointer field in ICMP addresses start byte of problem in IP header Code 1 required part of option is missing
18
Björn Landfeldt School of Information Technologies ping - ICMP echo request/reply ping program useful diagnostic tool, uses ICMP echo request/reply packets Linux implementation uses “raw” sockets - i/f directly to ip layer, bypass transports older ping would send 1 pkt per second some newer pings require -s to do that and only do one ping (“joebob is alive”)
19
Björn Landfeldt School of Information Technologies Ping ping adds identifier/sequence number fields to packets id field, unix pid as raw socket can’t tell how to demux packets to apps, app gets all copies, must demux itself sequence # allows you to see if packets disappeared ping will also do roundtrip timing
20
Björn Landfeldt School of Information Technologies More ping so what do you learn? –timing info, does it take too long ? –are packets being lost (why? didn’t tell you) –you can route (!!!) –end system’s tcp/ip stack is working at least echo reply sent by end system’s ICMP, you don’t know that you can telnet there...
21
Björn Landfeldt School of Information Technologies Ping example $ ping cse.ogi.edu PING cse.ogi.edu (129.95.20.2): 56 data bytes 64 bytes from 129.95.20.2 icmp_seq=0 time=8ms 64 bytes from 129.95.20.2 icmp_seq=1 time=8ms 64 bytes from 129.95.20.2 icmp_seq=2 time=20ms ---cse.ogi.edu PING statistics --- 3 packets transmitted, 3 packets received, 0% loss round-trip (ms) min/avg/max = 8/12/20
22
Björn Landfeldt School of Information Technologies Traceroute % traceroute north.pole.com traceroute (a command) allows you to determine the routers from one end to another uses ICMP ttl exceeded and (UDP port unreachable OR ICMP echo reply) messages to do the job
23
Björn Landfeldt School of Information Technologies Traceroute example % traceroute cse.ogi.edu (from sirius.cs.pdx.edu) traceroute to cse.ogi.edu (129.95.20.2), 30 hops max... 1. pdx-gwy (131.252.20.1) 3 ms 4 ms 3 ms 2. 198.104.197.58 (198.104.197.58) 7 ms 4 ms 8 ms 3. portland1-gw.nwnet.net (198.104.196.193) 6 ms 5 ms 5 ms 4. ogi-gw-nwnet.net (198.104.196.129) 8 ms 7 ms 7 ms 5. cse.ogi.edu (129.95.20.2) 14 ms 7 ms 9 ms note: try from usyd to unsw or some other uni in the Sydney area. how many hops? how long?
24
Björn Landfeldt School of Information Technologies Traceroute algorithm ttl = 1 (to 1st router) while we haven’t got UDP port unreachable send raw/ip packet with ttl == 1 get response if time exceeded note roundtrip time else if UDP port unreachable quit print output ttl++
25
Björn Landfeldt School of Information Technologies Address mask If host does not know its netmask, issue Address mask request Router on network replies with mask Can be unicast or broadcast Often used at boot strapping
26
Björn Landfeldt School of Information Technologies Router solicitation Host wants to learn about network topology issues ICMP RS message Routers reply with a router advertisement Preference level 0 means default router
27
Björn Landfeldt School of Information Technologies Packet-pair Problem, what is the bandwidth of the links between me and destination? Use packet-pair to find bottleneck link speed
28
Björn Landfeldt School of Information Technologies Algorithm Issue two packets back-to- back On each link write time will space packets Remote host might compact again Read time between packets on return path
29
Björn Landfeldt School of Information Technologies Packet-pair
30
Björn Landfeldt School of Information Technologies Pathchar Combine packet-pair with traceroute Algorithm Set TTL to 1 While host not reached Issue lots of packet-pair probes Measure link speed link delay related to previous result TTL++ end
31
Björn Landfeldt School of Information Technologies IP Final frontier, Mobility Once a socket opened, address cannot change –Change address – lose connection –Change place of attachment – lose routing One solution MobileIP RFC2002
32
Björn Landfeldt School of Information Technologies MobileIP MIP allows hosts to migrate to foreign networks Communication handled by Home Agent in home network Helper routers in foreign network Foreign Agents
33
Björn Landfeldt School of Information Technologies MIP Home Network Foreign Network HA FA 1 2 3
34
Björn Landfeldt School of Information Technologies IP Tunneling IP Router IP
35
Björn Landfeldt School of Information Technologies IP Tunnelling IP FA IP
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.