Analysis of the establishment and release of TCP connections using the Tcpdump capture packet under Linux

Source: Internet
Author: User
Tags ack

I use the environment for the WIN7 64-bit flagship version under the VirtualBox installation of the centOS6.5 experimental environment


Establish a connection

————————————————————————————————————————————————————————————————

In Terminal 1, enter root permissions, type tcpdump tcp-vx-i eth2

#使用man手册查看tcpdump的使用方法

#eth2为接口, you can use ARP-A to display the current interface


In Terminal 2, type telnet www.baidu.com

#远程登录www. Baidu.com 80 Port

Information about the connection pack that appears in Terminal 1, such as

The figure contains three packages:

1. From the local computer to the remote, the flag is [S], that is, set SYN, establish the connection, SEQ is 1189337464

2. From the remote to the local computer, the flag is [S.], that is, the SYN is set, see the ACK value is 1189337465, is the remote response to the local computer to establish a connection requirements

3. From the local computer to the remote, ACK value is 1, three handshake is completed


Release connection

————————————————————————————————————————————————————————————————

Type Ctrl +] in Terminal 2, and exit Telnet

The unpacking information begins to appear in Terminal 1, such as


The figure contains 4 packets, and the analysis packet can be found


Analysis of the establishment and release of TCP connections using the Tcpdump capture packet under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.