Click to Rate and Give Feedback
 How IT Works: Decoding TCP/IP
Tips
Discover how you can service Windows images and prepare Windows PE images with the new Deployment Image Servicing and Management (DISM) command line tool available with Windows 7. ...

Read more!

Before you can back up a Server Core computer, you must install the Windows Server Backup feature. This can be done in two ways, both of which we detail here. ...

Read more!

With Windows 7, it's easy to head off potential problems by preventing users from running unauthorized programs and scripts. Find out how. ...

Read more!

You can pin files and resources to the Taskbar for easy access to the documents you use most often. Find out how. ...

Read more!

Windows Server 2008 simplifies the Disk Management user interface by using one set of dialog boxes and wizards for both partitions and volumes. ...

Read more!

Related Articles

A virtual private network can provide improved connectivity and increased productivity—and it doesn't need to be difficult to implement and manage. Find out how you can use ISA Server 2006 to address two common VPN scenarios.

Alan Maddison

TechNet Magazine November 2007

...

Read more!

Single Sign On offers many advantages for both end users and administrators. Here's a look at how Single Sign On can simplify implementation of wireless authentication for your network.

Joseph Davies

TechNet Magazine November 2007

...

Read more!

The Network Policy Server (NPS) service in Windows Server 2008 replaces the Internet Authentication Service used in Windows Server 2003 and brings numerous enhancements, from the ability to enforce system health requirements to improved management capability.

Joseph Davies

TechNet Magazine December 2007

...

Read more!

Getting ready to move to IPv6? The Cable Guy explains how you can use an IPv6 transition technology to get IPv6 connectivity and migrate to an IPv6-capable intranet.

Joseph Davies

TechNet Magazine March 2008

...

Read more!

The VPN protocols in Windows XP and Windows Server 2003 don’t work for some configurations. Get an in depth look at the various issues and see how Windows Server “Longhorn” and Windows Vista with Service Pack 1 will use the Secure Socket Tunneling Protocol to solve these problems.

Joseph Davies

TechNet Magazine June 2007

...

Read more!

Popular Articles

The introduction of Hyper-V makes virtualization an even more compelling solution for IT environments. Get an overview of today’s virtualization market and see how Hyper-V improves the manageability, reliability, and security of virtualization

Rajiv Arunkundram

TechNet Magazine October 2008

...

Read more!

Discover how to use the Excel.Application automation model for a more powerful way to process data from your servers and take advantage of the analysis and charting tools built into Excel.

The Microsoft Scripting Guys

TechNet Magazine January 2009

...

Read more!

Project Server 2007 delivers significant enhancements, not only to the features and functionality for users but also for administrators. Alan Maddison explores some of the most significant new features and walks you through the installation and configuration of Microsoft Office Project Server 2007.

Alan Maddison

TechNet Magazine January 2009

...

Read more!

Consolidating servers onto fewer physical machines has many advantages, but it is extremely important that you plan for your systems to be highly available. Here’s a guide to using Windows Server 2008 Failover Clustering to bring high availability to your Hyper-V virtual machines.

Steven Ekren

TechNet Magazine October 2008

...

Read more!

The new Group Policy Preferences feature found in Windows Server 2008 and Windows Vista provides more than 3,000 settings, greatly expanding what administrators can do with Group Policy. Here’s a guide to using Group Policy Preferences to manage your environment.

Derek Melber

TechNet Magazine January 2009

...

Read more!

Our Blog

NAP monitors the health of specified computers when they attempt to connect to a network and includes a number of mechanisms to enforce health requirements. In this article, Geek of All Trades Greg Shields gives readers an overview of these enforcement mechanisms and, as an example, takes a closer look at setting ...

Read more!

Use Windows PowerShell to Manage Virtual Machines Here are a few examples of how you can use Windows PowerShell scripts to manage virtual machines running on a Server Core installation. Note that these scripts are presented as samples and may need to be customized to work in your environment.

Create a New ...

Read more!

Disabling an Unused Part of Group Policy Objects One way to disable a policy is to disable an unused part of the GPO. By disabling part of a policy that isn’t used, the application of GPOs and security will be faster.

Administer Windows Server 2008 Server Core from the Command Prompt ...

Read more!

In the August 2008 issue of TechNet Magazine, Paul Randal wrote an article Top Tips for Effective Database Maintenance.  It was geared toward "involuntary  DBAs" (IT pros who inadvertently wind up responsible for a SQL Server instance).  The article had a great response from our readers so Paul has written another ...

Read more!

Microsoft Forefront is designed to deliver an integrated security solution that makes it much easier to deploy and manage security across an organization’s IT infrastructure. In this, our annual security issue, we feature two articles that describe how Forefront Security protects instant messaging and e-mail.

Protect ...

Read more!

New information has been added to this article since publication.
Refer to the Editor's Update below.


How IT Works Decoding TCP/IP
Don Parker


TCP/IP is comprised of a set of protocols including Transmission Control Protocol (TCP), User Datagram Protocol (UDP), Internet Protocol (IP), and Internet Control Message Protocol (ICMP). Most IT professionals understand how these protocols work together to make network communication possible. They also know that IP is used for routing and that TCP is a transport protocol. However, it's not as well known what the various fields mean in a standard TCP/IP packet. Let's dive into the details.
A TCP/IP connection begins with a three-way handshake, used to initiate communications between computers, and is composed of three packets. This handshake usually begins with a synchronize (SYN) packet sent from a client to a server, followed by a synchronize/acknowledgement (SYN/ACK) packet from the server back to the client, and finally an acknowledgement (ACK) packet from the client back to the server. The final ACK packet is optional depending on the operating system you are using.
Let's look at and decipher an example TCP/IP packet, shown in the figure. This is the first step in the three-way TCP/IP handshake. A SYN packet like this is used to initiate communication and synchronize sequence numbers.
[Editor's Update - 5/5/2005:This was captured using the tool WinDump. Other utilities will most likely format and augment the results differently. For example, the timestamp discussed in the following section is inserted by WinDump and is not actually included in the data sent across the wire.]

09:09:52.283919
This is the time that my computer actually received the packet (not the time that it was sent). This time is accurate to the microsecond as represented by the six numbers after the last decimal point.

xxx.xxx.xxx.xxx.10459
Following the IP address 192.168.1.100 is the number 10459. This is the source port on the source computer that sent this packet.

>
The greater-than symbol shows the flow of communications, namely that the IP address to the left of the symbol is talking to the one on the right of the symbol.

192.168.1.200.80
This is the destination computer's IP address (192.168.1.200) as well as the destination port (80). You can infer that the client computer is trying to initiate communications with a Web server, since port 80 is the default used by HTTP servers such as IIS to listen for client connections.

S
The "S" that follows the IP address confirms this is a SYN packet.

[tcp sum ok]
This is also known as "TCP Checksum OK," and conveys that the checksum—as calculated by the source computer—is valid. When the source computer sends a packet, it adds to the packet the result of running a mathematical formula called a checksum over the contents of the packet, and it embeds the results into the packet's header. When the packet is received by the destination computer, the destination computer performs the same calculation on the received data. If the destination finds that its calculated checksum is the same as that embedded in the received packet's header, the packet will be processed.

3153110659:3153110659
This long string of numbers is the TCP sequence number. The number in parentheses that follows the sequence number represents the amount of data bytes sent. In this case, the value is zero as a SYN packet contains only a header and no data. In other words, no data has been sent as the two computers have not yet completed the three-way handshake.

win 32768
Window size is represented by win 32768, meaning the client computer has a window size of 32768 bytes. Also commonly known as the receive buffer, this metric is normally controlled by the application in use and indicates to the receiving computer the number of bytes that the client is willing to receive unacknowledged (once the source computer sends an acknowledgement to the destination computer, the destination can then send more data). In this case, we've surmised that the client is starting up communications with a Web server, so it is likely that this window size is that of Microsoft® Internet Explorer. If the server sends more information than the maximum allowed by the window size, the client may simply drop the extra packets due to a full buffer.

<mss 536>
Maximum segment size is represented by the number within the angle brackets. This value, as sent by the source computer, tells the destination to send no more than 536 bytes of data in any one packet. The Maximum Transmission Unit (MTU) for Ethernet is 1540.

(ttl 63, id 60989, len 44)
The value ttl 63 represents the packet's time-to-live, which defines the number of router hops that can be made before this packet will be dropped. In this example, 63 more router hops can be made before the packet will be dropped by the next router in line. When a router receives a packet with a ttl of 1, it will drop this packet and send an ICMP error message back to the originator. This prevents packets from flying around endlessly if they cannot reach their destination. I know that the source computer is running Windows® 2000 Professional, which has a default ttl of 128. That means that this packet went through quite a few hops before this capture was taken.
The TTL on the source computer had been changed from the default to a much lower number, meaning that the number of hops was significantly less than is implied.
Next is id 60989, the number assigned to the IP header. This number is used for packet fragmentation purposes. Should a packet need to be split into multiple pieces by a router, each fragment that is generated will have the same IP ID number assigned to it. The destination computer needs this to be able to reassemble them. Were this packet actually fragmented, there would also be a value called the fragmentation offset included (there's no use having fragments if you don't also know in what order they need to be reassembled).
Most current operating systems have the DF (don't fragment) bit set by default. If a router receives a packet with the DF bit set, and that packet is too big for the router to route, then the router will simply discard the packet, since the router would need to fragment it to pass it along. This will, in turn, cause the router to generate an ICMP error message, which it will send back to the originator of the packet to let it know.
Lastly, there is len 44, which represents the overall length of the packet. This includes not only the byte count of TCP and IP headers, but also the data sent, if any. Everything is measured in bytes.
At the end of the packet is a mass of hexadecimal values as well as some ASCII content. While this may seem cryptic, it actually isn't—all you are seeing is the TCP and IP header information of the packet that was just examined, but this time in a hexadecimal representation. You can, if you choose, decode these hexadecimal values yourself instead of letting the computer do it for you, but doing so is not for the faint of heart.

Don Parker works in a high-assurance environment where he is employed as a network security analyst. He has been a guest speaker at various computer security conferences, and holds the GCIA and GCIH certifications. His Web site is www.bridonsecurity.com.
© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker