packet capture techniques - wireshark · packet capture techniques ... drive, database log vols,...

59
Packet Capture Techniques Paul Offord, Advance7

Upload: lykiet

Post on 04-Jun-2018

255 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Packet Capture TechniquesPaul Offord, Advance7

Page 2: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Groups of capture techniques

• Directly from the user PC or on a server

• Based on switch capabilities

• Via purpose-built devices

• In a virtual environment

Page 3: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

On The Client: Topology

PCServer

Network

Page 4: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Wireshark executables

Start Wireshark

Start a capture

Page 5: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Very Large Frames

Page 6: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

TCP Segmentation Offload

PC or

Server

Process

Ethernet

SwitchPC or Server

NIC

T

C

P

I

P

E

t

h

L = 5 KB L = 1,518 bytes

L = 1,518 bytes

L = 1,518 bytes

L = 798 bytes

L = 1,518 bytes

L = 1,518 bytes

L = 1,518 bytes

L = 1,518 bytes

May be bigger than

Jumbo Frame

(>9,000 bytes MTU)

T

C

P

I

P

D

r

i

v

e

r

Without

Large Receive Offload

(LRO)

Page 7: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

On The Client: Advantages

• Easy to achieve

• Zero disruption to services

• Capture wireless traffic

• Capture VPN traffic inside the tunnel

Page 8: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

On The Client: Considerations

• TCP Seg. Offload can be confusing

• Disk contention may cause lost packets

• Potential performance hit when saving to C:

- Page files, EXEs, DLL, Memory Mapped Files

- Consider USB drive

• Use dumpcap for long-term captures

Page 9: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

On The Server: Topology

PCServer

Use

dumpcap

Network

Page 10: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Discovering unknown interactions

PCServer

Network

Another

server

Page 11: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

On The Server: Advantages

• Relatively easy to achieve

• Minimal disruption to services- Change Request probably needed

• All client traffic visible

• All interactions with other services visible

• Blade and VM east-west traffic visible

Page 12: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

On The Server: Considerations

• TCP Seg. Offload can be confusing

• Volume of data higher than client-side capture

• Save to a dedicated volume- Not to C: drive, database log vols, etc.

- USB drives work well

• Use dumpcap not tshark or Wireshark

• Care needed when teaming used

• Intra-OS tracing not possible on Windows- Loopback adapter not the same as Linux

Page 13: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Via loopback

App

Server

Database

Server

dumpcap

Linux OS

Source and destination IP address is 127.0.0.1

– use TCP port number to determine packet direction

Page 14: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

RawCap

App

Server

Database

Server

RawCap

Windows OS

Produces PCAP files

IPv4 only

Windows 2008 r2 onwards

Page 15: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Time for

Questions

Page 16: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN-Monitor-Mirror: Topology

PC

ServerCapture

Switch

Destination Port

Source Port

Cisco – monitor session …

Juniper - set ethernet-switching options analyzer …

Network

Page 17: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN-Monitor-Mirror: Uplink

Servers

Capture

Switch

Network

Server VLANVoice VLAN

IPT

System

PC to any server

No server to server

Phone to IPT

N

S

EW

No IPT to IPT

Page 18: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN-Monitor-Mirror: VLAN

Servers

Capture

Switch

Network

Server VLANVoice VLAN

IPT

System

PC to any server

Server to server

No IPT

No IPT to IPT

Packets flowing

North-South

will appear in the

capture twice

(flagged as Dup’s)

Page 19: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Asymmetric

Routing Gotcha

Switch

Svr Svr Svr Svr

User VLANs

WAN transit VLAN

Server VLAN

WAN

Router

Core

Switch

Core

Switch

HSRP /

VRRP

Pair

PS

Page 20: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Teaming (LBFO)

Switch A Switch B

Network

Server

Team

Always capture

both interfaces!

Options:

- Active/standby

- Generic or static teaming (IEEE 802.3ad)

- Dynamic teaming (IEEE 802.1ax, LACP)

Page 21: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Teaming: Switch independent mode

Switch A Switch B

Network

Server

Team

Page 22: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN-Monitor-Mirror: Advantages

• Easy to configure

• Low risk – non-invasive

• Multiple sources into one destination

• Entire VLANs can be monitored- Need to monitor on each switch

- May see duplicates

• Negligible impact on the switch

Page 23: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN-Monitor-Mirror: VLAN Gotcha

Capture

Switch A

PCServer

Switch BVLAN

130

This won’t work!

Page 24: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN-Monitor-Mirror: 2-into-1

Destination PortSource Port

Tx - 1Gbps

Rx - 1Gbps

Monitor - 2Gbps

(switch Tx)

Page 25: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Cut-through switches

Nexus Switch

In theory, the switch just

needs to see the DMAC

address.

In practice it uses more so

that it can support ACLs etc.

Ethernet

IP

TCP

Page 26: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Virtual Output Queues

Nexus Switch

VOQIngress port Egress port

Page 27: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Cisco Nexus Back-pressure Gotcha

Nexus Switch

VOQIngress port monitor source

monitor destination

Queuing due to

monitor destination

port congestion

Page 28: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN Rate Limiting

Configuring the Rate Limit for SPAN Traffic

By configuring a rate limit for SPAN traffic to 1Gbps across the entire monitor session, you can avoid

impacting the monitored production traffic. For Nexus 5000 series switches:

• When spanning more than 1Gbps to a 1 Gb SPAN destination interface, SPAN source traffic will

not drop.

• When spanning more than 6 Gbps (but less than 10Gbps) to a 10Gb SPAN destination interface,

the SPAN traffic is limited to 1Gbps even though the destination/sniffer is capable of 10Gbps.

On the Nexus 5500 series, SPAN traffic is rate-limited to 1Gbps by default so the switchport monitor

rate-limit 1G interface command is not supported. Also, to avoid impacting monitored production

traffic:

• SPAN is rate-limited to 5 Gbps for every 8 ports (one ASIC).

• RX-SPAN is rate-limited to 0.71 Gbps per port when the RX-traffic on the port exceeds 5 Gbps.

Different rules and

commands for

Nexus 7000

Page 29: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

SPAN-Monitor-Mirror: Considerations

• Overload of the monitor destination

• Back-pressure on source port (Cisco Nexus)- Alleviated using source rate limiting

• Limited number of monitor sessions

• Requires a spare switch port for destination

• Makes and models vary -> review first

Page 30: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

PCServerCapture

Switch

Cisco ACL / VACL: TopologyACL – Access Control List

VACL – VLAN Access Control List Match a packet to criteria

Take an action

Page 31: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Cisco ACL / VACL: Advantages

• VACL Capture on Catalyst

• ACL Capture on Nexus

• Similar to monitor/mirror but also …

• Wide range of monitor criteria- IP addresses, port numbers, etc.

- Helps avoid destination overload

• More sessions possible

• Is this the future for capture on Cisco?

Page 32: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Cisco ACL / VACL: Considerations

• As per monitor/mirror plus …

• Complicated to configure

• Greater risk of a mistake and so production impact

• Risk of not capturing the expected traffic

Page 33: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Time for

Questions

Page 34: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Blade Enclosure: Front

Page 35: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Blade Enclosure: Rear

Page 36: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Blade Enclosure: Topology

App

Server

DB

Server

Enclosure Switch

Network

Blade Blade

Capture

Chassis

File

Server

Blade

Page 37: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Blade Enclosure Alternative

App

Server

DB

Server

Enclosure Switch

Network

Blade Blade Blade

Chassis

Page 38: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Blade enclosure: Advantages

• Easy to configure

• Low risk – non-invasive

• Multiple sources into one destination

• Often entire VLANs can be monitored- Need to monitor on each switch

- May see duplicates

• Negligible impact on the switch

Page 39: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Blade enclosure: Considerations

• Overload of the monitor destination

• Limited number of monitor sessions

• Requires a spare switch port for destination- Often all external ports are in use

• Makes and models vary -> review first

Page 40: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Cisco UCS Fabric Interconnect

Server

Storage UCS Interconnect Switch

Capture

FCoE Limited to 1Gbps

Page 41: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Cisco UCS Fabric Interconnect

Server

Storage UCS Interconnect Switch

Capture

Ethernet Limited to 1Gbps

Page 42: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

UCS Fab Interconnect: Advantages

• Quick and easy to configure

• Visibility to East-West traffic

• Monitor multiple source

• Monitor VLANs

• Capture storage traffic (FCoE)

Page 43: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

UCS Fab Interconnect: Considerations

• Monitoring limited to 1Gbps- This probably negates the storage trace capability

• Monitor src and dst must be on same FI

• Limit of two monitor sessions

Page 44: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Time for

Questions

Page 45: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

TAP

Switch

Aggregator TapNon-aggregator Tap

Switch

ServerServerCapture Capture

TAP TAP

Page 46: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

TAP: Advantages

• Reduces risk of dropped packets

• Captures all information including physical

errors

• Totally passive

• Will not affect host performance

Page 47: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

TAP: Considerations

• Need to break network link to install

• More expensive

• Less flexible

• Non-aggregators require two capture ports

• Aggregators suffer 2-into-1 problem

Page 48: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Network Packet Broker

NPB

SPAN

Monitor

Mirror

TAP Other

Sources

Filter

Slice

Timestamp

De-dup

Many-to-many

Page 49: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Time for

Questions

Page 50: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

ESX vSwitch Promiscuous Mode

App

Server

DB

Server

PC

WTS or

vSphere

Client

vSwitch

Network

VM VM VM

ESX Host

vAnalyser

(dumpcap)

Page 51: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Promiscuous Mode: Advantages

• Minimal disruption to services- Change Request probably needed

• Can capture all intra-vSwitch traffic- East-West

Page 52: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Promiscuous Mode: Considerations

• vAnalyser VM required

• Care regarding destination of trace data- Not to sensitive volumes

• Anecdote that causes high CPU load- This has not been our experience

• Capture will not follow vMotioned guest

Page 53: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Hyper-V Monitor Port

App

Server

DB

Server

PC

WTS

Client

vSwitch

Network

VM VM VM

RDP

Hyper-V

vAnalyser

(dumpcap)

Page 54: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Hyper-V Monitor Port: Advantages

• Similar to monitor/mirror on a physical switch

• Minimal disruption to services- Change Request probably needed

• Can capture all intra-vSwitch traffic- East-West

Page 55: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Hyper-V Monitor Port: Considerations

• vAnalyser required

• Care regarding destination of trace data- Not to sensitive volumes

Page 56: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Ixia Phantom vTap

App

Server

Web

Server

vSwitch

Network

VM VM

ESX / Hyper-V / XenServer

GRE Terminator

Capture

vTap

Mgmt

VM

Page 57: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Ixia Phantom Tap: Advantages

• No software required on VM’s

• No impact to VM performance

• vTap can capture all vSwitch traffic

• Or can capture specific traffic

• Works on the leading hypervisors

• Can track a VM thru’ ESX vMotion

Page 58: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Ixia Phantom Tap: Considerations

• vTap Management VM on each host

• Annual subscription for each physical host

• Sensitive to vTap Mgmt. VM performance

Page 59: Packet Capture Techniques - Wireshark · Packet Capture Techniques ... drive, database log vols, etc. ... • Non-aggregators require two capture ports • Aggregators suffer 2-into-1

Further information

LinkedIn

Communities

TribeLab

- Free tutorials

- Free guides

- Free resources

Paul Offord FBCS CITP

Mobile: +44 1279 211 668

Email: [email protected]

Web: www.advance7.com