Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part...

29
© Copyright IBM Corp. 2011. All rights reserved. Winter 2011 – Session 8319 End the journey through the dark Turn on the light with wireshark Matthias Burkhard IBM Germany Tuesday, March 1, 2011: 4:30PM-5:30PM Anaheim Convention Center, Room 212A : mreede : Matthias Burkhard [email protected] [email protected] IP Wizards

Transcript of Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part...

Page 1: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

© Copyright IBM Corp. 2011. All rights reserved.

Winter 2011 – Session 8319 End the journey through the dark Turn on the light with wireshark

Matthias Burkhard IBM Germany

Tuesday, March 1, 2011: 4:30PM-5:30PMAnaheim Convention Center, Room 212A

: mreede : Matthias Burkhard [email protected] [email protected] IP Wizards

Page 2: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

2© Copyright IBM Corp. 2011. All rights reserved.

Turn on the light with wireshark End the journey through the dark

Page 3: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

3© Copyright IBM Corp. 2011. All rights reserved.

The mother of all IP diagnostics: PING

Ping comes in with TTL 49src_ip is 205.144.107.201

Ping reply leaves with TTL 64src_ip is 198.147.171.51

http://en.wikipedia.org/wiki/Sonar„active sonar is emitting pulses of sounds and listening for echoes. Sonar may be used as a means of acoustic location and of measurement of the echo characteristics of "targets" in the water.“

Page 4: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

4© Copyright IBM Corp. 2011. All rights reserved.

TTL and Topology I. Ping comes in with TTL 49

src_ip is 205.144.107.201Ping reply leaves with TTL 64

src_ip is 198.147.171.51

205.144.107.201 198.147.171.51TTL=64 PING replyTTL=49 PING

D NET,EEDIAG,TEST=YES can be used to determine the ip route towards a destination hostWorks similar to the IP traceroute, sending IP packets with too short TTL soliciting ICMP TTL exceeded messages.

Page 5: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

5© Copyright IBM Corp. 2011. All rights reserved.

Flow Graph EEDIAG TEST=YES

IP Packets are sent to all EE ports with TTL of 1, if no ICMP TTL exceeded response is received the packet is resent with 3.3 seconds interval) If a TTL exceeded message is received, the sender's src_ip and the RTT will be remembered

First hop router didn't answer1st ??? - 3 retransmissions2nd 10.128.104.993rd 10.128.104.85...

Page 6: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

6© Copyright IBM Corp. 2011. All rights reserved.

The traceroute for HPR/IP: EEDIAG TEST=YES

TTL 12 was the last packet getting an ICMPTTL 13 reached the other end.

The destination is 12 hops awayThe TEST OK comes in with a TTL of 49

Page 7: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

7© Copyright IBM Corp. 2011. All rights reserved.

TTL and Topology II.

205.144.107.201 198.147.171.51

TTL=12 TTL=1TTL=2TTL=3TTL=4TTL=5TTL=6TTL=10TTL=11 TTL=7TTL=8

245ICMP_TTL 246247 58246251252254??? 253253

TTL=9

TTL=12 TTL=1TTL=11 TTL=10 TTL=7 TTL=6 TTL=5 TTL=4 TTL=3 TTL=2TTL=9 TTL=8TTL=13

OK_TTL 49

If the TTL is too low, it will solicit an ICMP packet from the router that saw a TTL=1Inspecting the source ip address and its own TTL enables us to complete the picture

The packet with TTL 13 reached the other end. The destination is 12 hops away

The TEST OK comes in with a TTL of 49

Page 8: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

8© Copyright IBM Corp. 2011. All rights reserved.

TTL and Topology III.

205.144.107.201 198.147.171.51

TTL=49

Looking at the returned TTLs, we can make assumptions as to how the routers are connected.

TTL=12

ICMP_TTL

TTL=11 TTL=10TTL=8

TTL=7 TTL=6TTL=9

TTL=1

245

TTL=5 TTL=4 TTL=3 TTL=2

246247 58246251252253

253254???

Page 9: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

9© Copyright IBM Corp. 2011. All rights reserved.

TTL and Topology IV.

205.144.107.201 198.147.171.51

TTL=49

Routers send with a TTL of 255Linux sends with a TTL of 64 A gap in the TTLs indicates a VPN IPSec tunnel is in the path

TTL=12

ICMP_TTL

TTL=11 TTL=10TTL=8

TTL=7 TTL=6TTL=9

TTL=1

245

TTL=5

TTL=3

TTL=2

246

247

58

246

TTL=4

251252253

253254???

FIREWALL

IBM

Page 10: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

10© Copyright IBM Corp. 2011. All rights reserved.

TTL and Topology V. - NAT

205.144.107.201

198.147.171.51

TTL=49

The ICMP messages from the last 6 hops are all 'from the same ip-address“The TTLs are different though and so are the IPID ranges

TTL=12

ICMP_TTL

TTL=11 TTL=10TTL=8

TTL=7 TTL=6TTL=9

TTL=1

245

TTL=5

TTL=3

TTL=2

246

247

58

246

TTL=4

251252253

253254???

FIREWALL

IBM

10.128.104

10.40.20199.220.40

NAT

Page 11: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

11© Copyright IBM Corp. 2011. All rights reserved.

Fragmentation is bad While the IP protocol provides for fragmentation and reassembly in today's networks we cannot assume that fragmented ip packets will allways be allowed through the firewall infrastructure. FW filter rules typically check on ip address pair, protocol and port numbers With fragmentation, this information is not present in 2nd and following fragments.

A 1486 bytes packet came in unfragmentedIPID 65AD was fragmented

1st fragment: 44 bytes2nd fragment 1494 bytes

Fragmentation is bad – BAD Fragmentation is bad – BAD – BAD

TTL changes to 48!

Page 12: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

12© Copyright IBM Corp. 2011. All rights reserved.

TTL and Topology VI. - Fragmentation

205.144.107.201

198.147.171.51

TTL=49

Fragmented IP packets get inspected adding an additional hop to the ip path.

TTL=12

ICMP_TTL

TTL=11 TTL=10TTL=8

TTL=7 TTL=6TTL=9

TTL=1

245

TTL=5

TTL=3

TTL=2

246

247

58

246

TTL=4

251252253

253254???

FIREWALL

IBM

10.128.104

10.40.20199.220.40

NAT

FIREWALL

IBM

Fragments

Page 13: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

13© Copyright IBM Corp. 2011. All rights reserved.

Now we have picture of the environment Time to get started working on the 'problem'

What is your problem?

Inop? Pathswitch?

Page 14: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

14© Copyright IBM Corp. 2011. All rights reserved.

Detecting INOPs with wireshark

Incoming XID gets answered and DISConnected immediately!

No matching SWNET PU found ?!?DYNPU=YES?

Page 15: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

15© Copyright IBM Corp. 2011. All rights reserved.

Active link – sSAP and dSAP

So this link was activated by our VTAMYes SAPADDR=8 in

SWNET is default

There is an active HPR pipe between the two ip addresses when the XIDcomes inLocal SAP is 4, remote SAP is 8.

Page 16: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

16© Copyright IBM Corp. 2011. All rights reserved.

New link – sSAP and dSAP

So this link is a parrallel TG between the two!No longer supported

between same IP-pair

The XIDcomes in with a Local SAP of 8, remote SAP is 4.

Page 17: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

17© Copyright IBM Corp. 2011. All rights reserved.

Now we have picture of the environment Time to get started working on the 'problem'

So, what is your problem?

Inop? Pathswitch?

Page 18: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

18© Copyright IBM Corp. 2011. All rights reserved.

How to find switching pipes

Let's expand the trace in this timeframe!Yeah, tune in and listen

to ICMP.FM

Page 19: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

19© Copyright IBM Corp. 2011. All rights reserved.

PATHSWITCH due to routing loop

Our outbound NLPs die in a routing loop!

Yes, if they don't make it to the remote RTP a PATHSWITCH is the logical consequence

Page 20: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

20© Copyright IBM Corp. 2011. All rights reserved.

Routing Loop: TTL exceeded

Who's that?Let's check our picture!

The ICMP message comes in with a TTL of 245

Page 21: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

21© Copyright IBM Corp. 2011. All rights reserved.

Now we have picture of the environment Time to get started working on the 'problem'

So, what is your problem?

Inop? Pathswitch?

Page 22: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

22© Copyright IBM Corp. 2011. All rights reserved.

TTL and Topology VII. - Here's the problem

205.144.107.201

198.147.171.51

TTL=49

Fragmented IP packets get inspected adding an additional hop to the ip path.

TTL=64

ICMP_TTL

TTL=631

TTL62TTL=60

TTL=59 TTL=58TTL=61

TTL=1

245

TTL=57

TTL=55 246

247

58

246

TTL=56

251252253

253254???

FIREWALL

IBM

10.128.104

10.40.20199.220.40

NAT

FIREWALL

IBM

Fragments Routing Loop245

Page 23: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

23© Copyright IBM Corp. 2011. All rights reserved.

Wireshark Personal Configuration Files - Profiles

Page 24: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

24© Copyright IBM Corp. 2011. All rights reserved.

Wireshark Personal Configuration Files - Profiles

Page 25: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

25© Copyright IBM Corp. 2011. All rights reserved.

Questions

• IP Wizards on Facebook

• Wireshark Bootcamp 2011 • Germany: http://tinyurl.com/ZOWIE0DE• Canada : http://tinyurl.com/ZOWIE0CE

Page 26: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

26© Copyright IBM Corp. 2011. All rights reserved.

Appendix

• IP Fragmentation

Page 27: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

27© Copyright IBM Corp. 2011. All rights reserved.

Fragmentation: Why ? – Part I. An unfragmented packet arrives

IPID 65AB arrived unfragmentedip.len==1486 udp.length == 1466sna.nlp.thdr.dlf == 0x0000058f

ip.len is 20 bytes more than udp.lengthThe NLP payload was

0x058f = 1423 bytes

Page 28: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

28© Copyright IBM Corp. 2011. All rights reserved.

Fragmentation: Why ? – Part II. What was the original size of the packet?

IP Header 1st fragmentip.len==44 ip.id == 0x65adip.flags.mf == 1

UDP Headerudp.length == 1498

ANR Headersna.nlp.nhdr.anr == d0:00:00:00:00:00:00:00:ff

RTP THDR:sna.nlp.thdr.tcid == 3d:??:??:??:??:??:??:??

ip,len at the sender must have been 1498+20 bytes!

Page 29: Winter 2011 – Session 8319 End the journey through the dark ......Fragmentation: Why ? – Part II. What was the original size of the packet? IP Header 1st fragment ip.len==44 ip.id

29© Copyright IBM Corp. 2011. All rights reserved.

Fragmentation: Why ? – Part III. What was the original DLF of the NLP?

IP Header: 2nd fragmentip.len==1494 ip.id == 0x65ad

RTP THDR:sna.nlp.thdr.tcid == 3d:b4:27:f2:00:01:09:7csna.nlp.thdr.offset == 0x000dsna.nlp.thdr.dlf == 0x0000058fsna.nlp.thdr.bsn == 0x0010ac5a

Optional Segmentssna.nlp.thdr.optional.type == 0x22sna.nlp.thdr.optional.type == 0x0e

FID5 TH NLP payload was 0x058f Same as before!