Search /
Docfinder:
Advanced search  |  Help  |  Site map
RESEARCH CENTERS
SITE RESOURCES
Click for Layer 8! No, really, click NOW!
Networking for Small Business
TODAY'S NEWS
Apple tops the $100B+ tech club
How to get the IRS' attention: Forge nearly $8 million in tax returns, steal identities
How the Phoenix Suns basketball team takes on social media attacks
Microsoft details Windows 8 for ARM devices
Blogger exposes major Google Wallet security flaw
Web app lets enterprise set security, sharing for Google Apps users
Cloudscaling to offer OpenStack private cloud platform
Macs take on the enterprise
Valentine's Day Patch Tuesday: Microsoft to issue 9 patches, 4 critical
Mobile World Congress sneak peek: Quad-core smartphones, Ice Cream Sandwich & more
Microsoft details 'Windows on ARM' program
March debut of 'iPad 3' a sure bet, says analyst
Resume Makeover: How an Information Security Professional Can Target CSO Jobs
FBI unbolts Steve Jobs 1991 investigation file
/

A guide to original SYN

Gibbs archive

Last week we discussed ports in some detail. This week, even more detail. To understand how ports work and the ways they behave, we need to understand how TCP/IP functions.

Ports are numbered from one through 65,535. Inbound connections (connections to services) have traditionally "listened" on the lower-numbered ports from one to 1,023 - called "system" ports. Client computers making outbound connections generally are allocated any free port above 1,023 as a "source port." A list of standard port assignments can be found at www.isi.edu/in-notes/iana/assignments/port-numbers.

When two computers communicate using TCP/IP, they are transferring either User Datagram Protocol (UDP) or TCP packets inside IP packets. The IP header that precedes the UDP or TCP packet consists of control fields followed by the source address and destination address, followed by more control fields.

A UDP packet is relatively simple, consisting of a source port field (16 bits), followed by a destination port field (also 16 bits), a field to indicate the number of data bytes and a data checksum followed by actual data.

When we send a UDP packet, we are using a connectionless protocol, so we are not looking for a guaranteed response. If the port is available, our UDP packet will (hopefully) be received and a response generated, if appropriate or allowed. TCP is different and more complex - it is connection-oriented.

With TCP, first comes a source port field (16 bits), followed by a destination port field (also 16 bits) and then 74 bits for control data. Next comes six more bits of control data known as the Urgent Pointer field, the Acknowledgment field (ACK), the Push Function, the Connection Reset, Synchronize sequence numbers (SYN) and a flag for no more data from sender.

After that comes more control data to specify the size of the data and its checksum, and then even more control fields and the packet's payload - the data.

Now how does a TCP connection to a port get established? The process is called a "three-way handshake." The handshake starts with the source computer sending a TCP packet to the target computer with the SYN flag (a bit in the header) set and a random sequence number. The SYN flag indicates that a computer wants to establish a connection to a given port.

The normal response to a SYN request is a packet with the SYN and ACK flags set, the source's sequence number incremented by one, and the target's random sequence number. When the source machine receives this, it responds with an acknowledgment containing the target's sequence number incremented by one.

The sequence numbers provide each end of the "conversation" with an index of the sequence of packets transferred, letting each end know that all data is received, and even if a packet is corrupted or received out of sequence, it can be resent and kept in order.

When a SYN request is received, the target machine should respond with the second step of the handshake, the SYN-ACK. If the port is "open" - a SYN-ACK is generated - then it confirms that a connection is potentially possible whether an actual service is available on the port.

This has important consequences, as we shall see next week.

Connect to gearhead@gibbs.com.

RELATED LINKS


NWFusion offers more than 40 FREE technology-specific email newsletters in key network technology areas such as NSM, VPNs, Convergence, Security and more.
Click here to sign up!
New Event - WANs: Optimizing Your Network Now.
Hear from the experts about the innovations that are already starting to shake up the WAN world. Free Network World Technology Tour and Expo in Dallas, San Francisco, Washington DC, and New York.
Attend FREE
Your FREE Network World subscription will also include breaking news and information on wireless, storage, infrastructure, carriers and SPs, enterprise applications, videoconferencing, plus product reviews, technology insiders, management surveys and technology updates - GET IT NOW.