Wireshark Revealed: Essential Skills for IT Professionals - James H Baxter - E-Book

Wireshark Revealed: Essential Skills for IT Professionals E-Book

James H. Baxter

0,0
91,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Master Wireshark and discover how to analyze network packets and protocols effectively, along with engaging recipes to troubleshoot network problems

About This Book

  • Gain valuable insights into the network and application protocols, and the key fields in each protocol
  • Use Wireshark's powerful statistical tools to analyze your network and leverage its expert system to pinpoint network problems
  • Master Wireshark and train it as your network sniffer

Who This Book Is For

This book is aimed at IT professionals who want to develop or enhance their packet analysis skills. A basic familiarity with common network and application services terms and technologies is assumed.

What You Will Learn

  • Discover how packet analysts view networks and the role of protocols at the packet level
  • Capture and isolate all the right packets to perform a thorough analysis using Wireshark's extensive capture and display filtering capabilities
  • Decrypt encrypted wireless traffic
  • Use Wireshark as a diagnostic tool and also for network security analysis to keep track of malware
  • Find and resolve problems due to bandwidth, throughput, and packet loss
  • Identify and locate faults in communication applications including HTTP, FTP, mail, and various other applications – Microsoft OS problems, databases, voice, and video over IP
  • Identify and locate faults in detecting security failures and security breaches in the network

In Detail

This Learning Path starts off installing Wireshark, before gradually taking you through your first packet capture, identifying and filtering out just the packets of interest, and saving them to a new file for later analysis. You will then discover different ways to create and use capture and display filters. By halfway through the book, you'll be mastering Wireshark features, analyzing different layers of the network protocol, and looking for any anomalies.We then start Ethernet and LAN switching, through IP, and then move on to TCP/UDP with a focus on TCP performance problems. It also focuses on WLAN security. Then, we go through application behavior issues including HTTP, mail, DNS, and other common protocols. This book finishes with a look at network forensics and how to locate security problems that might harm the network.This course provides you with highly practical content explaining Metasploit from the following books:

  • Wireshark Essentials
  • Network Analysis Using Wireshark Cookbook
  • Mastering Wireshark

Style and approach

This step-by-step guide follows a practical approach, starting from the basic to the advanced aspects. Through a series of real-world examples, this learning path will focus on making it easy for you to become an expert at using Wireshark.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 1071

Veröffentlichungsjahr: 2017

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Wireshark Revealed: Essential Skills for IT Professionals
Credits
Preface
What this learning path covers
What you need for this learning path
Who this learning path is for
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Module 1
1. Getting Acquainted with Wireshark
Installing Wireshark
Installing Wireshark on Windows
Installing Wireshark on Mac OS X
Installing Wireshark on Linux/Unix
Performing your first packet capture
Selecting a network interface
Performing a packet capture
Wireshark user interface essentials
Filtering out the noise
Applying a display filter
Saving the packet trace
Summary
2. Networking for Packet Analysts
The OSI model – why it matters
Understanding network protocols
The seven OSI layers
Layer 1 – the physical layer
Layer 2 – the data-link layer
Layer 3 – the network layer
Internet Protocol
Address Resolution Protocol
Layer 4 – the transport layer
User Datagram Protocol
Transmission Control Protocol
Layer 5 – the session layer
Layer 6 – the presentation layer
Layer 7 – the application layer
Encapsulation
IP networks and subnets
Switching and routing packets
Ethernet frames and switches
IP addresses and routers
WAN links
Wireless networking
Summary
3. Capturing All the Right Packets
Picking the best capture point
User location
Server location
Other capture locations
Mid-network captures
Both sides of specialized network devices
Test Access Ports and switch port mirroring
Test Access Port
Switch port mirroring
Capturing packets on high traffic rate links
Capturing interfaces, filters, and options
Selecting the correct network interface
Using capture filters
Configuring capture filters
Capture options
Capturing filenames and locations
Multiple file options
Ring buffer
Stop capture options
Display options
Name resolution options
Verifying a good capture
Saving the bulk capture file
Isolating conversations of interest
Using the Conversations window
The Ethernet tab
The TCP and UDP tabs
The WLAN tab
Wireshark display filters
The Display Filter window
The display filter syntax
Typing in a display filter
Display filters from a Conversations or Endpoints window
Filter Expression Buttons
Using the Expressions window button
Right-click menus on specific packet fields
Following TCP/UDP/SSL streams
Marking and ignoring packets
Saving the filtered traffic
Summary
4. Configuring Wireshark
Working with packet timestamps
How Wireshark saves timestamps
Wireshark time display options
Adding a time column
Conversation versus displayed packet time options
Choosing the best Wireshark time display option
Using the Time Reference option
Colorization and coloring rules
Packet colorization
Wireshark preferences
Wireshark profiles
Creating a Wireshark profile
Selecting a Wireshark profile
Summary
5. Network Protocols
The OSI and DARPA reference models
Network layer protocols
Wireshark IPv4 filters
Wireshark ARP filters
Internet Group Management Protocol
Wireshark IGMP filters
Internet Control Message Protocol
ICMP pings
ICMP traceroutes
ICMP control message types
ICMP redirects
Wireshark ICMP filters
Internet Protocol Version 6
IPv6 addressing
IPv6 address types
IPv6 header fields
IPv6 transition methods
Wireshark IPv6 filters
Internet Control Message Protocol Version 6
Multicast Listener Discovery
Wireshark ICMPv6 filters
Transport layer protocols
User Datagram Protocol
Wireshark UDP filters
Transmission Control Protocol
TCP flags
TCP options
Wireshark TCP filters
Application layer protocols
Dynamic Host Configuration Protocol
Wireshark DHCP filters
Dynamic Host Configuration Protocol Version 6
Wireshark DHCPv6 filters
Domain Name Service
Wireshark DNS filters
Hypertext Transfer Protocol
HTTP Methods
Host
Request Modifiers
Wireshark HTTP filters
Additional information
Wireshark wiki
Protocols on Wikipedia
Requests for Comments
Summary
6. Troubleshooting and Performance Analysis
Troubleshooting methodology
Gathering the right information
Establishing the general nature of the problem
Half-split troubleshooting and other logic
Troubleshooting connectivity issues
Enabling network interfaces
Confirming physical connectivity
Obtaining the workstation IP configuration
Obtaining MAC addresses
Obtaining network service IP addresses
Basic network connectivity
Connecting to the application services
Troubleshooting functional issues
Performance analysis methodology
Top five reasons for poor application performance
Preparing the tools and approach
Performing, verifying, and saving a good packet capture
Initial error analysis
Detecting and prioritizing delays
Server processing time events
Application turn's delay
Network path latency
Bandwidth congestion
Data transport
TCP StreamGraph
IO Graph
IO Graph – Wireshark 2.0
Summary
7. Packet Analysis for Security Tasks
Security analysis methodology
The importance of baselining
Security assessment tools
Identifying unacceptable or suspicious traffic
Scans and sweeps
ARP scans
ICMP ping sweeps
TCP port scans
UDP port scans
OS fingerprinting
Malformed packets
Phone home traffic
Password-cracking traffic
Unusual traffic
Summary
8. Command-line and Other Utilities
Wireshark command-line utilities
Capturing traffic with Dumpcap
Capturing traffic with Tshark
Editing trace files with Editcap
Merging trace files with Mergecap
Mergecap batch file
Other helpful tools
HttpWatch
SteelCentral Packet Analyzer Personal Edition
AirPcap adapters
Summary
2. Module 2
1. Introducing Wireshark
Introduction
Locating Wireshark
Getting ready
How to do it...
Monitoring a server
Monitoring a router
Monitoring a firewall
How it works...
There's more...
See also
Starting the capture of data
Getting ready
How to do it...
How to choose the interface to start the capture
How to configure the interface you capture data from
How it works...
There's more...
See also
Configuring the start window
Getting ready
Main Toolbar
Display Filter Toolbar
Status Bar
How to do it...
Configuring toolbars
Configuring the main window
Name Resolution
Colorizing the packet list
Auto scrolling in live capture
Using time values and summaries
Getting ready
How to do it...
How it works...
Configuring coloring rules and navigation techniques
Getting ready
How to do it...
How it works...
See also
Saving, printing, and exporting data
Getting ready
How to do it...
Saving data in various formats
How to print data
How it works...
Configuring the user interface in the Preferences menu
Getting ready
How to do it...
Changing and adding columns
Changing the capture configuration
Configuring the name resolution
How it works...
Configuring protocol preferences
Getting ready
How to do it...
Configuring of IPv4 and IPv6 Preferences
Configuring TCP and UDP
How it works...
There's more...
2. Using Capture Filters
Introduction
Configuring capture filters
Getting ready
How to do it...
How it works...
There's more...
See also
Configuring Ethernet filters
Getting ready
How to do it...
How it works…
There's more...
See also
Configuring host and network filters
Getting ready
How to do it...
How it works…
There's more...
See also
Configuring TCP/UDP and port filters
Getting ready
How to do it...
How it works…
There's more...
See also
Configuring compound filters
Getting ready
How to do it...
How it works…
There's more...
See also
Configuring byte offset and payload matching filters
Getting ready
How to do it...
How it works…
There's more...
See also
3. Using Display Filters
Introduction
Configuring display filters
Getting ready
How to do it...
Choosing from the filters menu
Writing the syntax directly into the display filter window
Choosing a parameter in the packet pane and defining it as a filter
How it works...
There's more...
What is the parameter we filter?
Adding a parameter column
Saving the displayed data
Configuring Ethernet, ARP, host, and network filters
Getting ready
How to do it...
Ethernet filters
ARP filters
IP and ICMP filters
Complex filters
How it works...
Ethernet broadcasts
IPv4 multicasts
IPv6 multicasts
See also
Configuring TCP/UDP filters
Getting ready
How to do it...
How it works...
There's more...
See also
Configuring specific protocol filters
Getting ready
How to do it...
HTTP display filters
DNS display filters
FTP display filters
How it works...
See also
Configuring substring operator filters
Getting ready
How to do it...
How it works...
Configuring macros
Getting ready
How to do it...
How it works...
4. Using Basic Statistics Tools
Introduction
Using the Summary tool from the Statistics menu
Getting ready
How to do it...
How it works...
There's more...
Using the Protocol Hierarchy tool from the Statistics menu
Getting ready
How to do it...
How it works...
There's more...
Using the Conversations tool from the Statistics menu
Getting ready
How to do it...
How it works...
There's more...
Ethernet conversations statistics
IP conversations statistics
TCP/UDP conversations statistics:
Using the Endpoints tool from the Statistics menu
Getting ready
How to do it...
How it works...
There's more...
Using the HTTP tool from the Statistics menu
Getting ready
How to do it...
How it works...
There's more...
Configuring Flow Graph for viewing TCP flows
Getting ready
How to do it...
How it works...
There's more...
Creating IP-based statistics
Getting ready
How to do it...
How it works...
There's more...
5. Using Advanced Statistics Tools
Introduction
Configuring IO Graphs with filters for measuring network performance issues
Getting ready
How to do it...
Filter configuration
X-Axis configuration
Y-Axis configuration
How it works...
There's more...
Throughput measurements with IO Graph
Getting ready
How to do it...
Measuring throughput between end devices
Measuring application throughput
How it works...
There's more...
Graph SMS usage – finding SMS messages sent by a specific subscriber
Graphing number of accesses to the Google web page
Advanced IO Graph configurations with advanced Y-Axis parameters
Getting ready
How to do it...
How to monitor inter-frame time delta statistics
How to monitor the number of TCP retransmissions in a stream
How to monitor a number of field appearances
How it works...
There's more...
Getting information through TCP stream graphs – the Time-Sequence (Stevens) window
Getting ready
How to do it...
How it works...
There's more...
Getting information through TCP stream graphs – the Time-Sequence (tcp-trace) window
Getting ready
How to do it...
How it works...
There's more...
Getting information through TCP stream graphs – the Throughput Graph window
Getting ready
How to do it...
How it works...
There's more...
Getting information through TCP stream graphs – the Round Trip Time window
Getting ready
How to do it...
How it works...
There's more...
Getting information through TCP stream graphs – the Window Scaling Graph window
Getting ready
How to do it...
How it works...
There's more...
6. Using the Expert Infos Window
Introduction
The Expert Infos window and how to use it for network troubleshooting
Getting ready
How to do it...
How it works...
There's more...
See also
Error events and understanding them
Getting ready
How to do it...
How it works...
There's more...
See also
Warning events and understanding them
Getting ready
How to do it...
How it works...
There's more...
See also
Notes events and understanding them
Getting ready
How to do it...
How it works...
There's more...
See also
7. Ethernet, LAN Switching, and Wireless LAN
Introduction
Discovering broadcast and error storms
Getting ready
How to do it...
Spanning Tree Problems
A device that generates Broadcasts
Fixed pattern broadcasts
How it works...
There's more…
See also
Analyzing Spanning Tree Protocols
Getting ready
How to do it...
Which STP version is running on the network?
Are there too many topology changes?
How it works...
Port states
There's more…
Analyzing VLANs and VLAN tagging issues
Getting ready
How to do it...
Monitoring traffic inside a VLAN
Viewing tagged frames going through a VLAN tagged port
How it works...
There's more…
See also
Analyzing wireless (Wi-Fi) problems
Getting ready
How to do it…
How it works…
8. ARP and IP Analysis
Introduction
Analyzing connectivity problems with ARP
Getting ready
How to do it...
ARP poisoning and Man-in-the-Middle attacks
Gratuitous ARP
ARP sweeps
Requests or replies, and who is the sender
How many ARPs
How it works...
There's more...
Using IP traffic analysis tools
Getting ready
How to do it...
IP statistics tools
How it works...
There's more...
Using GeoIP to look up physical locations of the IP address
Getting ready
How to do it...
How it works...
There's more...
Finding fragmentation problems
Getting ready
How to do it...
How it works...
There's more...
Analyzing routing problems
Getting ready
How to do it...
How it works...
There's more...
Finding duplicate IPs
Getting ready
How to do it...
How it works...
There's more...
Analyzing DHCP problems
Getting ready
How to do it...
How it works...
There's more...
9. UDP/TCP Analysis
Introduction
Configuring TCP and UDP preferences for troubleshooting
Getting ready
How to do it...
UDP parameters
TCP parameters
How it works...
There's more…
TCP connection problems
Getting ready
How to do it...
How it works...
There's more…
TCP retransmission – where do they come from and why
Getting ready
How to do it...
Case 1 – retransmissions to many destinations
Case 2 – retransmissions on a single connection
Case 3 – retransmission patterns
Case 4 – retransmission due to a non-responsive application
Case 5 – retransmission due to delayed variations
Finding what it is
How it works...
Regular operation of the TCP Sequence/Acknowledge mechanism
What are TCP retransmissions and what do they cause
There's more...
See also
Duplicate ACKs and fast retransmissions
Getting ready
How to do it...
How it works...
There's more...
TCP out-of-order packet events
Getting ready
How to do it...
When will it happen?
How it works...
TCP Zero Window, Window Full, Window Change, and other Window indicators
Getting ready
How to do it...
TCP Zero Window, Zero Window Probe, and Zero Window Violation
TCP Window Update
TCP Window Full
How it works...
There's more…
TCP resets and why they happen
Getting ready
How to do it...
Cases in which reset is not a problem
Cases in which reset can indicate a problem
How it works...
10. HTTP and DNS
Introduction
Filtering DNS traffic
Getting ready
How to do it...
How it works...
There's more...
Analyzing regular DNS operations
Getting ready
How to do it...
How it works...
DNS operation
DNS namespace
The resolving process
There's more...
Analysing DNS problems
Getting ready
How to do it...
DNS cannot resolve a name
DNS slow responses
How it works...
There's more...
Filtering HTTP traffic
Getting ready
How to do it...
How it works...
HTTP methods
Status codes
There's more...
Configuring HTTP preferences
Getting ready
How to do it...
Custom HTTP headers fields
How it works...
There's more...
Analyzing HTTP problems
Getting ready
How to do it...
Informational codes
Success codes
Redirect codes
Client errors
Server errors
How it works...
There's more...
Exporting HTTP objects
Getting ready
How to do it...
How it works...
There's more...
HTTP flow analysis and the Follow TCP Stream window
Getting ready
How to do it...
How it works...
There's more...
Analyzing HTTPS traffic – SSL/TLS basics
Getting ready
How to do it...
How it works...
There's more...
11. Analyzing Enterprise Applications' Behavior
Introduction
Finding out what is running over your network
Getting ready
How to do it...
There's more...
Analyzing FTP problems
Getting ready
How to do it...
How it works...
There's more...
Analyzing e-mail traffic and troubleshooting e-mail problems – POP, IMAP, and SMTP
Getting ready
How to do it...
POP3 communications
SMTP communications
Some other methods and problems
How it works...
POP3
SMTP and SMTP error codes (RFC3463)
There's more...
Analyzing MS-TS and Citrix communications problems
Getting ready
How to do it...
How it works...
There's more…
Analyzing problems in the NetBIOS protocols
Getting ready
How to do it...
General tests
Specific issues
How it works...
There's more…
Example 1 – application freezing
Example 2 – broadcast storm caused by SMB
Analyzing database traffic and common problems
Getting ready
How to do it...
How it works...
There's more...
12. SIP, Multimedia, and IP Telephony
Introduction
Using Wireshark's features for telephony and multimedia analysis
Getting ready
How to do it...
How it works...
There's more...
Analyzing SIP connectivity
Getting ready
How to do it...
1xx codes – provisional/informational
2xx codes – success
3xx codes – redirection
4xx codes – client error
5xx codes – server error
6xx codes – global failure
How it works...
There's more...
Analyzing RTP/RTCP connectivity
Getting ready
How to do it...
How it works...
RTP principles of operation
The RTCP principle of operation
There's more...
Troubleshooting scenarios for video and surveillance applications
Getting ready
How to do it...
How it works...
There's more...
Troubleshooting scenarios for IPTV applications
Getting ready
How to do it...
How it works...
There's more...
Troubleshooting scenarios for video conferencing applications
Getting ready
How to do it...
Troubleshooting RTSP
Getting ready
How to do it...
How it works...
There's more...
13. Troubleshooting Bandwidth and Delay Problems
Introduction
Measuring total bandwidth on a communication link
Getting ready
How to do it...
How it works...
There's more...
Measuring bandwidth and throughput per user and per application over a network connection
Getting ready
How to do it...
How it works...
See also
Monitoring jitter and delay using Wireshark
Getting ready
How to do it...
How it works...
There's more...
Discovering delay/jitter-related application problems
Getting ready
How to do it...
How it works...
There's more...
14. Understanding Network Security
Introduction
Discovering unusual traffic patterns
Getting ready
How to do it...
How it works...
There's more...
See also
Discovering MAC- and ARP-based attacks
Getting ready
How to do it...
How it works...
There's more...
Discovering ICMP and TCP SYN/Port scans
Getting ready
How to do it...
How it works...
There's more...
See also
Discovering DoS and DDoS attacks
Getting ready
How to do it...
How it works...
There's more...
Locating smart TCP attacks
Getting ready
How to do it...
How it works...
There's more...
See also
Discovering brute-force and application attacks
Getting ready
How to do it...
How it works...
There's more...
A. Links, Tools, and Reading
Useful Wireshark links
tcpdump
Some additional tools
SNMP tools
SNMP platforms
The NetFlow, JFlow, and SFlow analyzers
HTTP debuggers
Syslog
Other stuff
Network analysers
Interesting websites
Books
3. Module 3
1. Welcome to the World of Packet Analysis with Wireshark
Introduction to Wireshark
A brief overview of the TCP/IP model
The layers in the TCP/IP model
An introduction to packet analysis with Wireshark
How to do packet analysis
What is Wireshark?
How it works
Capturing methodologies
Hub-based networks
The switched environment
ARP poisoning
Passing through routers
Why use Wireshark?
The Wireshark GUI
The installation process
Starting our first capture
Summary
Practice questions
2. Filtering Our Way in Wireshark
An introduction to filters
Capture filters
Why use capture filters
How to use capture filters
An example capture filter
Capture filters that use protocol header values
Display filters
Retaining filters for later use
Searching for packets using the Find dialog
Colorize traffic
Create new Wireshark profiles
Summary
Practice questions
3. Mastering the Advanced Features of Wireshark
The Statistics menu
Using the Statistics menu
Protocol Hierarchy
Conversations
Endpoints
Working with IO, Flow, and TCP stream graphs
IO graphs
Flow graphs
TCP stream graphs
Round-trip time graphs
Throughput graphs
The Time-sequence graph (tcptrace)
Follow TCP streams
Expert Infos
Command Line-fu
Summary
Exercise
4. Inspecting Application Layer Protocols
Domain name system
Dissecting a DNS packet
Dissecting DNS query/response
Unusual DNS traffic
File transfer protocol
Dissecting FTP communications
Passive mode
Active mode
Dissecting FTP packets
Unusual FTP
Hyper Text Transfer Protocol
How it works – request/response
Request
Response
Unusual HTTP traffic
Simple Mail Transfer Protocol
Usual versus unusual SMTP traffic
Session Initiation Protocol and Voice Over Internet Protocol
Analyzing VOIP traffic
Reassembling packets for playback
Unusual traffic patterns
Decrypting encrypted traffic (SSL/TLS)
Summary
Practice questions
5. Analyzing Transport Layer Protocols
The transmission control protocol
Understanding the TCP header and its various flags
How TCP communicates
How it works
Graceful termination
RST (reset) packets
Relative verses Absolute numbers
Unusual TCP traffic
How to check for different analysis flags in Wireshark
The User Datagram Protocol
A UDP header
How it works
The DHCP
The TFTP
Unusual UDP traffic
Summary
Practice questions
6. Analyzing Traffic in Thin Air
Understanding IEEE 802.11
Various modes in wireless communications
Wireless interference and strength
The IEEE 802.11 packet structure
RTS/CTS
Usual and unusual WEP – open/shared key communication
WEP-open key
The shared key
WPA-Personal
WPA-Enterprise
Decrypting WEP and WPA traffic
Summary
Practice questions
7. Network Security Analysis
Information gathering
PING sweep
Half-open scan (SYN)
OS fingerprinting
ARP poisoning
Analyzing brute force attacks
Inspecting malicious traffic
Solving real-world CTF challenges
Summary
Practice questions
8. Troubleshooting
Recovery features
The flow control mechanism
Troubleshooting slow Internet and network latencies
Client- and server-side latencies
Troubleshooting bottleneck issues
Troubleshooting application-based issues
Summary
Practice questions
9. Introduction to Wireshark v2
The intelligent scroll bar
Translation
Graph improvements
TCP streams
USBPcap
Summary
Practice questions
Bibliography
Index

Wireshark Revealed: Essential Skills for IT Professionals

Wireshark Revealed: Essential Skills for IT Professionals

Copyright © 2017 Packt Publishing

All rights reserved. No part of this course may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this course to ensure the accuracy of the information presented. However, the information contained in this course is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this course.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this course by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Published on: December 2017

Production reference: 1011217

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN - 978-1-78883-322-6

www.packtpub.com

Credits

Authors

James H Baxter

Yoram Orzach

Charit Mishra

Reviewers

Sarath Lakshman

Bruno Vernay

Ms. Samia Yousif

Charles L. Brook

Praveen Darshan

Ritwik Ghoshal

Gilbert Ramirez

Anish Nath

Content Development Editor

Devika Battike

Graphics

Kirk D’penha

Production Coordinator

Aparna Bhagat

Preface

Wireshark is a popular and powerful tool used to analyze the amount of bits and bytes that are flowing through a network. The packet captures displayed in Wireshark give you an insight into the security and flaws of different protocols, which will help you perform the security research and protocol debugging.

What this learning path covers

Module 1, Wireshark Essentials, introduces the Wireshark network analyzer to IT professionals across multiple disciplines.

It starts off with the installation of Wireshark, before gradually taking you through your first packet capture, identifying and filtering out just the packets of interest, and saving them to a new file for later analysis. The subsequent chapters will build on this foundation by covering essential topics on the application of the right Wireshark features for analysis, network protocols essentials, troubleshooting, and analyzing performance issues. Finally, this module focuses on packet analysis for security tasks, command-line utilities, and tools that manage trace files.

Upon finishing this module, you will have successfully added strong Wireshark skills to your technical toolset and significantly increased your value as an IT professional

Module 2, Network Analysis using Wireshark Cookbook, highlights the operations of Wireshark as a network analyzer tool. This book provides you with a set of practical recipes to help you solve any problems in your network using a step-by-step approach.

“Network analysis using Wireshark Cookbook” starts by discussing the capabilities of Wireshark, such as the statistical tools and the expert system, capture and display filters, and how to use them. The book then guides you through the details of the main networking protocols, that is, Ethernet, LAN switching, and TCP/IP, and then discusses the details of application protocols and their behavior over the network. Among the application protocols that are discussed in the book are standard Internet protocols like HTTP, mail protocols, FTP, and DNS, along with the behavior of databases, terminal server clients, Citrix, and other applications that are common in the IT environment.

In a bottom-up troubleshooting approach, the book goes up through the layers of the OSI reference model explaining how to resolve networking problems. The book starts from Ethernet and LAN switching, through IP, and then on to TCP/UDP with a focus on TCP performance problems. It also focuses on WLAN security. Then, we go through application behavior issues including HTTP, mail, DNS, and other common protocols. The book finishes with a look at network forensics and how to search and find security problems that might harm the network.

Module 3, Mastering Wireshark, will help you raise your knowledge to an expert level. At the start of this module, you will be introduced to its interface so you understand all its functionalities. Moving forward, you will discover different ways to create and use capture and display filters. Halfway through the book, you’ll be mastering the features of Wireshark, analyzing different layers of the network protocol, looking for any anomalies. As you reach to the end of the book, you will be taught how to use Wireshark for network security analysis and configure it for troubleshooting purposes.

What you need for this learning path

The primary requirement is as follows:

You will need to install the Wireshark software that can be downloaded from www.wireshark.org.

Who this learning path is for

This book is aimed at IT professionals who want to develop or enhance their packet analysis skills. A basic familiarity with common network and application services terms and technologies is assumed.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this course—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <[email protected]>, and mention the course’s title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt course, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this course from your account at http://www.packtpub.com. If you purchased this course elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

Log in or register to our website using your e-mail address and password.Hover the mouse pointer on the SUPPORT tab at the top.Click on Code Downloads & Errata.Enter the name of the course in the Search box.Select the course for which you’re looking to download the code files.Choose from the drop-down menu where you purchased this course from.Click on Code Download.

You can also download the code files by clicking on the Code Files button on the course’s webpage at the Packt Publishing website. This page can be accessed by entering the course’s name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR / 7-Zip for WindowsZipeg / iZip / UnRarX for Mac7-Zip / PeaZip for Linux

The code bundle for the course is also hosted on GitHub at :

https://github.com/PacktPublishing/Wireshark-Revealed-Essential-skills-for-IT-professionals

We also have other code bundles from our rich catalog of books, videos, and courses available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our courses—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this course. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your course, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the course in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this course, you can contact us at <[email protected]>, and we will do our best to address the problem.

Part 1. Module 1

Wireshark Essentials

Get up and running with Wireshark to analyze network packets and protocols effectively

Chapter 1. Getting Acquainted with Wireshark

Since its creation in 1997 by Gerald Combs to troubleshoot network problems at a small ISP, Wireshark (originally called Ethereal) has now become one of the most popular tools available for packet-level analysis of network and application protocols. This is mostly because it is an open source solution, which makes it freely available to any technical professional, as well as its extensive range of features, coverage of over 1000 protocols, and the continued support and improvements made possible by contributions from over 800 developers around the globe.

This introductory chapter will help you to quickly become proficient in Wireshark by installing it on your system and doing something fun and useful with it, before diving into more details and supporting concepts.

In this chapter, we will cover the following topics:

Installing WiresharkPerforming a packet captureWireshark user interface essentialsUsing display filters to isolate traffic of interestSaving a filtered packet trace file

The chapters that follow will build on and provide the supporting concepts for these basic functions to allow you to develop the Wireshark skills that are most applicable to your technical role and objectives.

Installing Wireshark

Wireshark can be installed on machines running 32- and 64-bit Windows (XP, Win7, Win8.1, and so on), Mac OS X (10.5 and higher), and most flavors of Linux/Unix. Installation on Windows and Mac machines is quick and easy because installers are available from the Wireshark website download page. Wireshark is a standard package available on many Linux distributions, and there is a list of links to third-party installers provided on the Wireshark download page for a variety of popular *nix platforms. Alternatively, you can download the source code and compile Wireshark for your environment if a precompiled installation package isn't available.

Wireshark relies on the WinPcap (Windows) or libpcap (Linux/Unix/Mac) libraries to provide the packet capture and capture filtering functions; the appropriate library is installed during the Wireshark installation.

Note

You might need administrator (Windows) or root (Linux/Unix/Mac) privileges to install Wireshark and the WinPcap/libpcap utilities on your workstation.

Assuming that you're installing Wireshark on a Windows or Mac machine, you need to go to the Wireshark website (https://www.wireshark.org/) and click on the Download button at the top of the page. This will take you to the download page, and at the same time attempt to perform an autodiscovery of your operating system type and version from your browser info. The majority of the time, the correct Wireshark installation package for your machine will be highlighted, and you only have to click on the highlighted link to download the correct installer.

Note

If you already have Wireshark installed, an autoupdate feature will notify you of available version updates when you launch Wireshark.

Installing Wireshark on Windows

In the following screenshot, the Wireshark download page has identified that a 64-bit Windows installer is appropriate for this Windows workstation:

Clicking on the highlighted link downloads a Wireshark-win64-1.10.8.exe file or similar executable file that you can save on your hard drive. Double-clicking on the executable starts the installation process. You need to follow these steps:

Agree to the License Agreement.Accept all of the defaults by clicking on Next for each prompt, including the prompt to install WinPcap, which is a library needed to capture packets from the Network Interface Card (NIC) on your workstation.Early in the Wireshark installation, the process will pause and prompt you to click on Install and several Next buttons in separate windows to install WinPcap.After the WinPcap installation is complete, click through the remaining Next prompts to finish the Wireshark installation.

Installing Wireshark on Mac OS X

The process to install Wireshark on Mac is the same as the process for Windows, except that you will not be prompted to install WinPcap; libpcap, the packet capture library for Mac and *nix machines, gets installed instead (without prompting).

There are, however, two additional requirements that may need to be addressed in a Mac installation:

The first is to install X11, a windowing system library. If this is needed for your system, you will be informed and provided a link that ultimately takes you to the XQuartz project download page so you can install this package.The second requirement that might come up is if upon starting Wireshark, you are informed that there are no interfaces on which a capture can be done. This is a permissions issue on theBerkeley packet filter (BPF) that can be resolved by opening a terminal window and typing the following command:
bash-3.2$ sudo chmod 644 /dev/bpf*

If this process needs to be repeated each time you start Wireshark, you can perform a web search for a more permanent permissions solution for your environment.

Installing Wireshark on Linux/Unix

The requirements and process to install Wireshark on a Linux or Unix platform can vary significantly depending on the particular environment. Wireshark is usually available by default through the package management systems for your specific Linux distribution. Guidance to install Wireshark on Linux can be found in Chapter 2, Networking for Packet Analysts, or in the Wireshark user documentation located at www.wireshark.org/docs/wsug_html_chunked/ChapterBuildInstall.html.

Performing your first packet capture

When you first start Wireshark, you are presented with an initial Start Page as shown in the following screenshot:

Don't get too fond of this screen. Although you'll see this every time you start Wireshark, once you do a capture, open a trace file, or perform any other function within Wireshark, this screen will be replaced with the standard Wireshark user interface and you won't see it again until the next time you start Wireshark. So, we won't spend much time here.

Selecting a network interface

If you have a number of network interfaces on your machine, you may not be sure which one to select to capture packets, but there's a fairly easy way to figure this out. On the Wireshark start page, click on Interface List (alternatively, click on Interfaces from the Capture menu or click on the first icon on the icon bar).

The Wireshark Capture Interfaces window that opens provides a list and description of all the network interfaces on your machine, the IP address assigned to each one (if an address has been assigned), and a couple of counters, such as the total number of packets seen on the interface since this window opened and a packets/s (packets per second) counter. If an interface has an IPv6 address assigned (which may start with fe80:: and contain a number of colons) and this is being displayed, you can click on the IPv6 address and it will toggle to display the IPv4 address. This is shown in the following screenshot:

Note

On Linux/Unix/Mac platforms, you might also see a loopback interface that can be selected to capture packets being sent between applications on the same machine. However, in most cases, you'll only be interested in capturing packets from a network interface.

The goal is to identify the active interface that will be used to communicate with the Internet when you open a browser and navigate to a website. If you have a wired local area network connection and the interface is enabled, that's probably the active interface, but you might also have a wireless interface that is enabled and you may or may not be the primary interface. The most reliable indicator of the active network interface is that it will have greater number of steadily increasing packets with a corresponding active number of packets/s (which will vary over time). Another possible indicator is if an interface has an IP address assigned and others do not. If you're still unsure, open a browser window and navigate to one of your favorite websites and watch the packets and packets/s counters to identify the interface that shows the greatest increase in activity.

Performing a packet capture

Once you've identified the correct interface, select the checkbox on the left-hand side of that interface and click on the Start button at the bottom of the Capture Interfaces window. Wireshark will start capturing all the packets that can be seen from that interface, including the packets sent to and from your workstation. You'll see a bewildering variety of packets going by in the top section (called the Packet List pane) of the screen; this is normal. If you don't see this, try a different interface.

It's a bit amazing just how much background traffic there is on a typical network, such as broadcast packets from devices advertising their names, addresses, and services to and from other devices asking for addresses of stations they want to communicate with. Also, a fair amount of traffic is generated from your own workstation for applications and services that are running in the background, and you had no idea they were creating this much noise. Your Wireshark's Packet List pane may look similar to the following screenshot; however, we can ignore all this for now:

We're ready to generate some traffic that we'll be interested in analyzing. Open a new Internet browser window, enter www.wireshark.org in the address box, and press Enter.

When the https://www.wireshark.org/ home page finishes loading, stop the Wireshark capture by either selecting Stop from the Capture menu or by clicking on the red square stop icon that's between the View and Go menu headers.

Wireshark user interface essentials

Once you have completed your first capture, you will see the normal Wireshark user interface main screen. So before we go much further, a quick introduction to the primary parts of this user interface will be helpful so you'll know what's being referred to as we continue the analysis process.

There are eight significant sections or elements of the default Wireshark user interface, as shown in the following screenshot:

Let's look at the eight significant sections in detail:

Title: This area reflects the interface from where a capture is being taken or the filename of an open packet trace fileMenu: This is the standard row of main functions and subfunctions in WiresharkMain toolbar (icons): These provide a quick way to access the most useful Wireshark functions and are well worth getting familiar with and usingDisplay filter toolbar: This allows you to quickly create, edit, clear, apply, and save filters to isolate packets of interest for analysisPacket list pane: This section contains a summary info line for each captured packet, as well as a packet number and relative timestampPacket details pane: This section provides a hierarchical display of information about a single packet that has been selected in the packet list pane, which is divided into sections for the various protocols contained in a packetPacket bytes pane: This section displays the selected packets' contents in hex bytes or bits form, as well as an ASCII display of the data that can be helpfulStatus bar: This section provides an expert info indicator, edit capture comments icon, trace file path name and size information, data on the number of packets captured and displayed and other info, and a profile display and selection section

Filtering out the noise

Somewhere in your packet capture, there are packets involved with loading the Wireshark home page—but how do you find and view just those packets out of all the background noise?

The simplest and most reliable method is to determine the IP address of the Wireshark website and filter out all the packets except those flowing between that IP address and the IP address of your workstation by using a display filter. The best approach—and the one that you'll likely use as a first step for most of your post-capture analysis work in future—is to investigate a list of all the conversations by IP address and/or hostnames, sorted by the most active nodes, and identify your target hostname, website name, or IP address from this list.

From the Wireshark menu, select Conversations from the Statistics menu, and in the Conversations window that opens, select the IPv4 tab at the top. You'll see a list of network conversations identified by Address A and Address B, with columns for total Packets, Bytes, Packets A→B, Bytes A→B, Packets A←B, and Bytes A←B.

Scrolling over to the right-hand side of this window, there are Relative Start values. These are the times when each particular conversation was first observed in the capture, relative to the start of the capture in seconds. The next column is Duration, which is how long this conversation persisted in the capture (first to last packet seen).

Finally, there are average data rates in bits per second (bps) in each direction for each conversation, which is the network impact for this conversation. All these are shown in the following screenshot:

We want to sort the list of conversations to get the busiest ones—called the Top Talkers in network jargon—at the top of the list. Click on the Bytes column header and then click on it again. Your list should look something like the preceding screenshot, and if you didn't get a great deal of other background traffic flowing to/from your workstation, the traffic from https://www.wireshark.org/ should have the greatest volume and therefore be at the top of the list.

In this example, the conversation between IP addresses 162.159.241.165 and 192.168.1.116 has the greatest overall volume, and looking at the Bytes A->B column, it's apparent that the majority of the traffic was from the 162.159.241.165 address to the 192.168.1.116 address. However, at this point, how do we know if this is really the conversation that we're after?

We will need to resolve the IP addresses from our list to hostnames or website addresses, and this can be done from within Wireshark by turning on Network Name Resolution and trying to get hostnames and/or website addresses resolved for those IP addresses using reverse DNS queries (using what is known as a pointer (PTR) DNS record type). If you just installed or started Wireshark, the Name Resolution option may not be turned on by default.

This is usually a good thing, as Wireshark can create traffic of its own by transmitting the DNS queries trying to resolve all the IP addresses that it comes across during the capture, and you don't really want that going on during a capture. However, the Name Resolution option can be very helpful to resolve IP addresses to proper hostnames after a capture is complete.

To enable Name Resolution, navigate to View | Name Resolution | Enable for Network Layer (click to turn on the checkmark) and make sure Use External Network Name Resolver is enabled as well. Wireshark will attempt to resolve all the IP addresses in the capture to their hostname or website address, and the resolved names will then appear (replacing the previous IP addresses) in the packet list as well as the Conversations window.

Note that the Name Resolution option at the bottom of the Conversations window must be enabled as well (it usually is by default), and this setting affects whether resolved names or IP addresses appear in the Conversations window (if Name Resolution is enabled in the Wireshark main screen), as shown in the following screenshot:

At this point, you should see the conversation pair between wireshark.org and your workstation at or near the top of the list, as shown in the following screenshot. Of course, your workstation will have a different name or may only appear as an IP address, but identifying the conversation to wireshark.org has been achieved.

Applying a display filter

You now want to see just the conversation between your workstation and wireshark.org, and get rid of all the extraneous conversations so you can focus on the traffic of interest. This is accomplished by creating a filter that only displays the desired traffic.

Right-click on the line containing the wireshark.org entry and navigate to Apply as Filter | Selected | A<->B, as shown in the following screenshot:

Wireshark will create and apply a display filter string that isolates the displayed traffic to just the conversation between the IP addresses of wireshark.org and your workstation, as shown in the following screenshot. Note that if you create or edit a display filter entry manually, you will need to click on Apply to apply the filter to the trace file (or Clear to clear it).

This particular display filter syntax works with IP addresses, not with hostnames, and uses an ip.addr== (IP address equals) syntax for each node along with the && (and) logic operator to build a string that says display any packet that contains this IP address *and* that IP address. This is the type of display filter that you will be using a great deal for packet analysis.

You'll notice as you scroll up and down in the Packet List pane that all the other packets, except those between your workstation and wireshark.org, are gone. They're not gone in the strict sense, they're just hidden—as you can observe by inspecting the Packet No. column, there are gaps in the numbering sequence; those are for the hidden packets.

Saving the packet trace

Now that you've isolated the traffic of interest using a display filter, you can save a new packet trace file that contains just the filtered packets.

This serves two purposes. Firstly, you can close Wireshark, come back to it later, open the filtered trace file, and pick up where you left off in your analysis, as well as have a record of the capture in case you need to reference it later such as in a troubleshooting scenario.

Secondly, it's much easier and quicker to work in the various Wireshark screens and functions with a smaller, more focused trace file that contains just the packets that you want to analyze.

To create a new packet trace file containing just the filtered/displayed packets, select Export Specified Packets from the Wireshark File menu.

You can navigate to and/or create a folder to hold your Wireshark trace files, and then enter a filename for the trace file that you want to save. In this example, the filename is wireshark_website.pcapng. By default, Wireshark will save the trace file in the pcapng format (which is the preferred format). If you don't specify a file extension with the filename, Wireshark will provide the appropriate extension based on the Save as type selection, as shown in the following screenshot:

Also, by default, Wireshark will have the All packets option selected, and if a display filter is applied (as it is in this scenario), the Displayed option will be selected as opposed to the Captured option that saves all the packets regardless of whether a filter was applied. Having entered a filename and confirmed that all the save selections are correct, you can click on Save to save the new packet trace file.

Note that when you have finished this trace file save activity, Wireshark still has all the original packets from the capture in memory, and they can still be viewed by clicking on Clear in the Display Filter Toolbar menu. If you want to work further with the new trace file you just saved, you'll need to open it by clicking on Open in the File menu (or Open Recent in the File menu).

Summary

Congratulations! If you accomplished all the activities covered in this chapter, you have successfully installed Wireshark, performed a packet capture, created a filter to isolate and display just the packets you were interested in from all the extraneous noise, and created a new packet trace file containing just those packets so you can analyze them later. Moreover, in the process, you gained an initial familiarity with the Wireshark user interface and you learned how to use several of its most useful and powerful features. Not bad for a first chapter.

In the next chapter, we'll review some essential network concepts needed to provide a solid foundation to perform packet-level analysis. The main goal of the next chapter is to help you develop a mental model of networking that lends itself well to packet-level analysis without getting too tangled up in unnecessary details.

Chapter 2. Networking for Packet Analysts

Packet analysis is all about analyzing how applications transfer useful data from point A to point B over networks. So, an understanding of how networks function is essential.

In this chapter, we will cover the following topics:

Why the seven-layer OSI model mattersIP networks and subnetsSwitching and routing packetsEthernet frames and switchesIP addresses and routersWAN linksWireless networking

The seven-layer OSI model will be mapped to the most common networking terms, and we'll review frames, switching, IP addressing, routing, and a few other networking topics of interest. The goal is to develop a mental model of networking that lends itself well to packet-level analysis.

The OSI model – why it matters

TheOpen Systems Interconnections (OSI) reference model is an industry recognized standard developed by the International Organization for Standardization (ISO) to divide networking functions into seven logical layers to support and encourage (relatively) independent development while providing (relatively) seamless interconnectivity between each layer from different hardware/software environments, platforms, and vendors. There's also a somewhat simpler four-layer Defense Advanced Research Projects Agency (DARPA) model that maps to the OSI model, but the OSI version is the most commonly referred to. I'll reference both models when discussing the various layers.

The following diagram compares the OSI and DARPA reference models:

Unless you're in the business of writing protocols, there's no need to study any of the seven layers in great depth, but it is helpful to understand them conceptually because these layers are referred to by the industry and your IT peers.

More importantly, it's essential that you know where and how these layers and their associated protocols are presented in Wireshark's Packet Details pane. We'll cover the layers from this aspect to help you remember them and get the most use from the discussion.

Understanding network protocols

Network protocols, like the OSI layers, are a set of industry standard rules and designs used to exchange messages and data between computers and applications. In any discussion about OSI layers, you are directly or indirectly referring to the protocols associated with a given layer—the most commonly known protocols are IP, UDP, TCP, HTTP, and so on—and the significant functions they perform.

For example, you'll often hear the terms network layer and IP layer used interchangeably, and it is assumed and understood that you are talking about the layer and the associated protocol that contains and uses IP addresses to route packets from point A to point B across the network. The discussions that follow will tie the OSI and DARPA layers to their associated protocols.

The seven OSI layers

As we cover the OSI layers starting from layer 1 and working up to layer 7, I'll outline how each layer's associated protocol(s) are displayed in Wireshark and/or used in networking hardware. The mental model you develop from this approach should be the most accurate and useful for packet analysis.

Layer 1 – the physical layer

The physical layer encompasses the electrical characteristics and mechanical standards to get data bits transmitted from a computer's Network Interface Card (NIC) to a switch port or between switch and router ports. The most common standards, terms, and devices you'll encounter at this layer include the following:

Ethernet: This is a family of networking technologies for local area networks (LANs).RJ-45: These are 8-pin modular connectors found on both ends of a copper Ethernet cable that are plugged into the NIC on a computer and a wall jack or switch portCat 5 (Cat 5e or Cat 6) cables: These are Ethernet cables that use twisted-pair copper wires. "Cat" stands for the category of cable and reflects its quality and data speed capabilities.100Base-T, 1000Base-T, and 1000Base-LX: These represent a particular Ethernet standard. 100Base-T is 100 Mbps over twisted-pair cable using RJ-45 connectors, 1000Base-LX is 1000 Mbps over fiber, and so on.Single-mode and multimode fiber optic cables: These use pulses of light from solid-state LEDs or lasers to transmit data bits.

The Ethernet standards used to connect NICs to switches are also used to connect switches together and to connect switches to routers or other network devices, although the cables and connectors used may vary depending on cable type and speed.

There are other layer 1 standards in common use, including 802.11 Wireless, Frame Relay, and ATM; the last two are used in long distancewide area networks (WANs).

Layer 2 – the data-link layer

The data-link layer organizes raw bits from the physical layer (typically Ethernet) into frames, which is the first manifestation of what is generally called a packet that you'll see in Wireshark. This layer is a dividing line between physical networking, electrical/mechanical standards, and the logical structures (protocols) used to format and transmit, receive, and decode packets of data in the higher layers.

In the DARPA reference model, the physical and data-link OSI layers are combined and called the network interface layer. The significant features and functions of this layer (for Ethernet II frames) include:

Media Access Control (MAC) addresses: These are the network addresses used in LANs. They are 6-byte network hardware addresses burned into memory chips on NICs, switches, routers, or other network device ports/interfaces:
The first three bytes of a MAC address are assigned to and can be associated with a specific manufacturer. Wireshark has a list of these and can display MAC addresses as a combination of the manufacturer code and the last three bytes. The manufacturer creates a unique last-three-bytes address for every interface so that each MAC address is unique across the globe. (Although, an NIC might be programmed to use another arbitrary MAC address, which is done for MAC spoofing for malicious attacks. But this is a very bad idea as another card may be using the same address and can cause a loss of data and some very confusing packet switching problems.)Ethernet frames include a destination and source MAC address. MAC addresses are used to switch (not route—we'll make the distinction shortly) frames between computers on the same LAN or between computers and a router or other device port on a LAN.
Type (or EtherType) field: This indicates the next higher protocol layer (typically IP (0800) or ARP (0806)). Wireshark uses this to determine the next protocol dissector to apply in packet decodes.Payload: This is the packet or datagram carried by the Ethernet frame.The frame check sequence: This is a 4-byte Cyclic Redundancy Check (CRC) error-detection code calculated from all the bits in a frame and added to the end of the frame. This is used to detect frames that have been corrupted usually because of faulty cables, noise induced on the wires in a cable from outside electrical signals, and so on. When a frame is received, this code is recalculated based on the bits received and compared to the FCS field. The bad frames are then discarded.

The following diagram illustrates the layout of the fields in an Ethernet frame:

A key point here—and this is important to understand—is that Ethernet frames and their MAC addresses are only able to transmit frames between devices on the local area network (LAN and IP subnet) they belong to.

Routers form the boundary between LANs by virtue of their IP subnet (subnetwork) addressing. All the devices belonging to the same IP subnet are part of the same LAN, and getting packets to or from a different subnet requires a router.

Once a frame enters a router port to get routed to a different/distant network, the Ethernet frame with its MAC addresses and FCS is stripped off and discarded. The payload inside the frame is routed to the port and it will leave on its way to the next device, and another frame with a different MAC address and recalculated FCS is created to encase the packet. This frame is then transmitted to the next destination.

The network devices that work at this layer—usually switches—are commonly referred to as layer 2 devices or layer 2 switches.

Finally, you should be aware that layer 2 switches can support several networking enhancements such as Virtual LAN (VLAN) and Class of Service (CoS) tagging, which is accomplished by adding a 4-byte 802.1Q field between the MAC addresses and EtherType field. You might see these frames between switches (but not on user ports).

VLAN is a layer 2 solution that allows administrative partitioning of various ports on a switch into separate broadcast domains. Devices located on different VLANs are effectively isolated from each other as if they were on separate physical networks. VLANs can be dispersed across multiple switches without running separate cables for each VLAN if the switches support VLAN tagging. Communication between devices on separate VLANs generally requires using a router.

In the following Wireshark packet details screenshot, the Ethernet II frame Destination and Source MAC addresses, Type (indicating that the next layer protocol is IP), and Frame check sequence are circled, as is the Frame summary.

Note

Wireshark displays a summary of each frame that includes frame sizes, captured timestamps and interframe times, and other useful information. This is metadata calculated by Wireshark to aid in analysis and not a part of the captured frame.

The following screenshot highlights the significant fields of an Ethernet frame:

Note

Any additional analysis provided by Wireshark in any area of the Packet Details pane that is calculated or otherwise not part of actual packet contents will be encased in brackets.

Layer 3 – the network layer

The network layer (called the Internet layer in the DARPA model) primarily handles the routing of packets across and to other networks along the path from source computers to destination hosts based on the destination IP address. The two most common protocols seen at this layer are Internet Protocol and Address Resolution Protocol.

Internet Protocol

The most common protocol in use at this layer is Internet Protocol Version 4 (IPv4), which includes several essential fields to accomplish the task of routing packets across networks:

Differentiated Services (DiffServ): This field supports an enhancement to the IP that is generally called Quality of Service (QoS) and allows classification of certain types of traffic (voice, video, and so on) so that these packets can receive priority handling in cases of network congestion.Total length: This is the total length of the packet (minus the Ethernet MAC header).Identification (IP ID): This an incrementing number used to support fragmentation.Flags: These are used to support fragmenting (dividing a packet into two or more smaller ones) in case the large packets have to be divided into several smaller ones to traverse a packet-size-limited link. These flags along with the IP ID field values allow proper reassembly of the fragmented packets into the original.Fragment offset: If theFlag field is 1 (more fragments), the value in this field indicates the offset from the start of the original payload in bytes that this fragment packet contains.Time to Live (TTL): This is a "hop" or time counter that is decremented every time a packet passes through a router. If the TTL reaches zero, the packet is discarded. The primary purpose is to keep packets from living forever and crashing the network in the case of an inadvertent path loop.Protocol: This