Third experiment using Packet Tracer analysis TCP connection is established objects

Name: Zhang Yue

Class: calculated 1811

Student ID: 201821121006

1. The experiment

1. Use a different network router

2. Use the command line router

3. crawling through HTTP packets, TCP connection establishment process analysis

2. Experimental content

1. Packet Tracer, properly configure the network parameters, by crawling HTTP packets, analyzes the TCP connection establishment procedure. Establish a network topology.

2. Configure the experimental parameters content

3. Ethereal

4. Analysis of data packets

3.1 Establish a network topology

3.2 configure parameters

Router configuration parameters:

 First, click on the router to open CLU, then enter a different turn commands on the command line;

   The instructions: Router> enable access privileges model

      Router # config t Enter the global configuration mode

      Router (config) #interface Fa 0/0 Ethernet interface 0/0

      Router (config-if) #ip address 192.168.1.7 255.255.255.0 add IP addresses

     Router (config-if) #no shutdown activation port

     Router (config-if) #exit return to the previous 

     Router (config) #interface Fa 0/1 Ethernet interface 0/1

    Router (config-if) #ip address 192.168.2.7 255.255.255.0 add IP addresses

    Router (config-if) #no shutdown activation port                  

Capture, analyze TCP setup process

 

TCP to establish a connection diagram:

 

Change in number and confirmation number

The first handshake: a client first creates a transmission control module, a TCP connection is established; in this case the header sync bit SYN = 1, while selecting an initial sequence number seq = x

第二次握手:在服务端向客户端发送的确认报文中,SYN位和ACK位都置为1,确认号是ack=x+1,同时也为自己选择一个初始序号seq=y

第三次握手:客户端受到确认报文后,还要给服务端回应;ACK置为1,确认号ack=y+1,而自己的序号seq=x+1

为什么连接建立要三次握手?

答:防止已经失效的连接请求报文段突然又传到服务端,因而产生错误”,这种情况是:一端(client)A发出去的第一个连接请求报文并没有丢失,而是因为某些未知的原因在某个网络节点上发生滞留,导致延迟到连接释放以后的某个时间才到达另一端(server)B。本来这是一个早已失效的报文段,但是B收到此失效的报文之后,会误认为是A再次发出的一个新的连接请求,于是B端就向A又发出确认报文,表示同意建立连接。如果不采用“三次握手”,那么只要B端发出确认报文就会认为新的连接已经建立了,但是A端并没有发出建立连接的请求,因此不会去向B端发送数据,B端没有收到数据就会一直等待,这样B端就会白白浪费掉很多资源。如果采用“三次握手”的话就不会出现这种情况,B端收到一个过时失效的报文段之后,向A端发出确认,此时A并没有要求建立连接,所以就不会向B端发送确认,这个时候B端也能够知道连接没有建立。 

 

Guess you like

Origin www.cnblogs.com/hltz/p/11679086.html