wireshark抓包实验之TCP(陕师大)
wireshark抓取TCP连接及断开实验
计算机网络实验报告年级:姓名:学号:实验日期:实验名称:利用wireshark抓取TCP连接及断开实验一、实验目的:1)掌握TCP连接建立的三次握手过程2)理解TCP连接释放的四次握手过程二、实验原理:TCP协议工作原理参考TCP协议Tcp显示过滤规则:tcp.flags 显示包含TCP标志的封包。
tcp.flags.syn == 1显示包含TCP SYN标志的封包。
tcp.flags.syn == 1and tcp.flags.ack == 0 显示包含TCP SYN并且不包含ACK标志的封包。
tcp.flags.fin == 1and tcp.flags.ack == 1 显示包含TCP FIN和ACK标志的封包。
tcp.window_size == 0 && tcp.flags.reset != 1三、主要设备、器材1)已联网且运行Windows操作系统的计算机2)协议分析软件Wireshark四、要求1、结果分析与保存的数据一致,否则没有实验成绩2、数据保存名称:tcp数据:w09101-tcp.pcap(网络091班01号arp协议)实验结果分析报告名称:实验六利用Wireshark分析tcp协议_w09101.doc五、实验步骤:1)启动WireShark抓包2)访问学校主页服务器,通过Wireshark捕获通信内容3)分析TCP连接建立的三次握手和连接释放的四次握手过程浏览网页,抓取三次握手的包,根据TCP包头格式将各字段取值填下来。
源IP:目的IP:源端口:目的端口:第一次握手:找出第一次握手的数据包并截取对该数据包的展开图,根据截图填写横线内容。
替换上图序号:确认号:数据偏移:URG:ACK:PSH:RST:FIN:窗口:若只抓取第一次握手的数据包,则显示过滤器的规则为并截图替换下图:第二次握手:找出第二次握手的数据包并截取对该数据包的展开图,根据截图填写横线内容。
西安邮电大学计算机网络wireshark抓包分析实验报告
西安邮电大学计算机网络wireshark 抓包分析实验报告西安邮电大学《计算机网络技术与应用》课内实验报告书院系名称: 管理工程学院实验题目: Wireshark 抓包工具实验报告学生姓名: 易霜霜专业名称: 信息管理与信息系统班级: 信管1101 学号: 02115021 时间: 2013 年06 月26 日实验报告实验名称Wireshark 抓包工具一、实验目的了解Wireshark 的使用方法,利用wireshark 对数据报进行分析。
二、实验内容用wireshark抓包,然后对数据进行分析,抓UDF和FTP的包。
然后对它们进行分析。
三、设计与实现过程(1) 安装wireshark 软件,并熟悉wireshark 软件的使用。
(2) 完成物理机器的操作系统(host os) 与虚拟机中操作系统(guest os) ,在物理机上设置虚拟网卡,设置host os 和guest os 的IP 地址,分别为192.168.228.1 和192.168.228.2.(3) 在guest os 上配置各种网络服务,包括有:Web、Email 、DNS、FTP。
(4)在host os 上启动wireshark 抓包,从host os 访问guest os 上的各种服务,完成抓包实验。
1. UDP 协议分析由于DNS 委托的是UDP 协议提供传输服务,所以我们以 DNS 查询中的UDP 数据 报为例,分析其首部的封装形式^=DvcfaKi. Oer 认i-IKirrj fert :请㈡.KTiKrTF 呼;叫册冷 戸和 fly&'i iTTpi ifcyt-: plywr 上和翼pr?;诗雷’ MlKFligi purl ;鼻导尸L 曲卑戶PKsvu m : flyXiHuis O^LiBClB pnz 血fl 鞋 iMau : M2SJ- LKllrut pirli. s 存占二归:* 空迂屯 m :辱显*杞摯 Ufflirrdfir sori MyQr:屈LX4 _ MZ14- L~ b "JC :X " . J < : A ; . f -Li ■九 _ K Pl"t E ,-..'! - -"LZ □ '"x .1T■*-■»■•■ jrv ■-■ > 1,■厂 jrr . m I ・ * i l« 尸 *■ * ' F IIL IlfCff! LKI f «■■ ■'・ I +4 b L" I" ■・ll* F ・"■:-P - 3User Datagram Procol(用户数据报协议):首部长度20字节;总长度164字节;协议为UDP 协议,协议号为17;首部校验和:0x07b4;源端口号 Source Port no.56254;目标端口号 Destination Port no.plysrv-https(6771);长度:144字节;数据部分:136字节;在计算检验和时,临时把“伪首部”和 UDP 用户数据报连接在一起。
陕师大计算机网络WireShark_01
WireShark-01班级:计科一班学号:41112009 姓名:熊思平1. List the different protocols that appear in the protocol column in the unfiltered packet-listing window in step 7 above.there are such different protocols in the unfiltered packing-listing window:UDP、ICQ、TCP、ARP、DNS、HTTP、NBNS.2. How long did it take from when the HTTP GET message was sent until the HTTP OK reply was received? (By default, the value of the Time column in the packet- listing window is the amount of time, in seconds, since Wireshark tracing began.To display the Time field in time-of-day format, select the Wireshark View pull down menu, then select Time Display Format, then select Time-of-day .)Times=23.3870450-23.3863380=70703. What is the Internet address of the (also known as www- )? What is the In ternet address of your computer?My computer address:172.16.0.35The nternet address of the (also known as www-):128.119.245.124. Print the two HTTP messages displayed in step 9 above. To do so, select Print from the Wireshark File command menu, and select “Selected Packet Only”and“Print as displayed”and then click OK.。
Wireshark抓包工具计算机网络实验
Wireshark抓包工具计算机网络实验实验一 Wireshark使用一、实验目的1、熟悉并掌握Wireshark的基本使用;2、了解网络协议实体间进行交互以及报文交换的情况。
二、实验环境与因特网连接的计算机,操作系统为Windows,安装有Wireshark、IE等软件。
三、预备知识要深入理解网络协议,需要观察它们的工作过程并使用它们,即观察两个协议实体之间交换的报文序列,探究协议操作的细节,使协议实体执行某些动作,观察这些动作及其影响。
这种观察可以在仿真环境下或在因特网这样的真实网络环境中完成。
Wireshark是一种可以运行在Windows, UNIX, Linux等操作系统上的分组嗅探器,是一个开源免费软件,可以从下载。
运行Wireshark程序时,其图形用户界面如图2所示。
最初,各窗口中并无数据显示。
Wireshark的界面主要有五个组成部分:命令和菜单协议筛选框捕获分组列表选定分组首部明细分组内容左:十六进制右:ASCII码图1命令菜单(command menus):命令菜单位于窗口的最顶部,是标准的下拉式菜单。
协议筛选框(display filter specification):在该处填写某种协议的名称,Wireshark据此对分组列表窗口中的分组进行过滤,只显示你需要的分组。
捕获分组列表(listing of captured packets):按行显示已被捕获的分组内容,其中包括:分组序号、捕获时间、源地址和目的地址、协议类型、协议信息说明。
单击某一列的列名,可以使分组列表按指定列排序。
其中,协议类型是发送或接收分组的最高层协议的类型。
分组首部明细(details of selected packet header):显示捕获分组列表窗口中被选中分组的首部详细信息。
包括该分组的各个层次的首部信息,需要查看哪层信息,双击对应层次或单击该层最前面的“+”即可。
分组内容窗口(packet content):分别以十六进制(左)和ASCII码(右)两种格式显示被捕获帧的完整内容。
wireshark实验抓包分析
TCP:(TCP是面向连接的通信协议,通过三次握手建立连接,通讯完成时要拆除连接,由于TCP 是面向连接的所以只能用于点对点的通讯)源IP地址:发送包的IP地址;目的IP地址:接收包的IP地址;源端口:源系统上的连接的端口;目的端口:目的系统上的连接的端口。
TCP是因特网中的传输层协议,使用三次握手协议建立连接。
当主动方发出SYN连接请求后,等待对方回答SYN,ACK。
这种建立连接的方法可以防止产生错误的连接,TCP使用的流量控制协议是可变大小的滑动窗口协议。
第一次握手:建立连接时,客户端发送SYN包(SEQ=x)到服务器,并进入SYN_SEND状态,等待服务器确认。
第二次握手:服务器收到SYN包,必须确认客户的SYN(ACK=x+1),同时自己也送一个SYN包(SEQ=y),即SYN+ACK包,此时服务器进入SYN_RECV状态。
第三次握手:客户端收到服务器的SYN+ACK包,向服务器发送确认包ACK(ACK=y+1),此包发送完毕,客户端和服务器进入Established状态,完成三次握手。
第一行:帧Frame1指的是要发送的数据块;其中,捕获字节等于传输的字节数第二行:以太网,是数据链路层;源MAC地址是:00:19:c6:00:06:3d,目的MAC地址是:00:1c:25:d4:91:9a;第三行:IPV4,源IP地址:172.24.3.5;目的IP是:172.24.7.26;第四行:协议类型:TCP;源端口bctp(8999),目的端口:2376;序列号:每发送一个RTP数据包,序列号就加1;ACK是TCP数据包首部中的确认标志,对已接收到的TCP报文进行确认,其为 1表示确认号有效;长度是1448字节;第五行:数据总有1448字节;其中,对应的TCP首部的数据信息:端口号:数据传输的16位源端口号和16位目的端口号(用于寻找发端和收端应用进程);该数据包相对序列号是1(此序列号用来确定传送数据的正确位置,且序列号,用来侦测丢失的包);下一个数据包的序列号是1449;Acknowledgement number是32位确认序号,其等于1表示数据包收到,确认其有效;收到的数据包的头字节长度是4位32比特;Flags含6个标志比特:URG紧急指针(urgentpointer)有效ACK确认序号有效。
wireshark 实验 TCP
Wireshark Lab: TCP Version: 2.0© 2007 J.F. Kurose, K.W. Ross. All Rights ReservedComputer Networking: A Top-down Approach, 4th edition.In this lab, we’ll investigate the behavior of TCP in detail. We’ll do so by analyzing a trace of the TCP segments sent and received in transferring a 150KB file (containing the text of Lewis Carrol’s Alice’s Adventures in Wonderland) from your computer to a remote server. We’ll study TCP’s use of sequence and acknowledgement numbers for providing reliable data transfer; we’ll see TCP’s congestion control algorithm – slow start and congestion avoidance – in action; and we’ll look at TCP’s receiver-advertised flow control mechanism. We’ll also briefly consider TCP connection setup and we’ll investigate the performance (throughput and round-trip time) of the TCP connection between your computer and the server.Before beginning this lab, you’ll probably want to review sections 3.5 and 3.7 in the text.11. Capturing a bulk TCP transfer from your computer to a remote serverBefore beginning our exploration of TCP, we’ll need to use Wireshark to obtain a packet trace of the TCP transfer of a file from your computer to a remote server. You’ll do so by accessing a Web page that will allow you to enter the name of a file stored on your computer (which contains the ASCII text of Alice in Wonderland), and then transfer the file to a Web server using the HTTP POST method (see section 2.2.3 in the text). We’re using the POST method rather than the GET method as we’d like to transfer a large amount of data from your computer to another computer. Of course, we’ll be running Wireshark during this time to obtain the trace of the TCP segments sent and received from your computer.1 All references to the text in this lab are to Computer Networking: A Top-down Approach, 4th edition.Do the following:•Start up your web browser. Go the /wireshark-labs/alice.txt and retrieve an ASCII copy of Alice in Wonderland. Store this filesomewhere on your computer.•Next go to /wireshark-labs/TCP-wireshark-file1.html.•You should see a screen that looks like:•Use the Browse button in this form to enter the name of the file (full path name) on your computer containing Alice in Wonderland (or do so manually).Don’t yet press the “Upload alice.txt file” button.•Now start up Wireshark and begin packet capture (Capture->Options) and then press OK on the Wireshark Packet Capture Options screen (we’ll not need toselect any options here).•Returning to your browser, press the “Upload alice.txt file” button to upload the file to the server. Once the file has been uploaded, a shortcongratulations message will be displayed in your browser window.•Stop Wireshark packet capture. Your Wireshark window should look similar to the window shown below.If you are unable to run Wireshark on a live network connection, you can download a packet trace file that was captured while following the steps above on one of the author’s computers2. You may well find it valuable to download this trace even if you’ve captured your own trace and use it, as well as your own trace, when you explore the questions below.2 Download the zip file /wireshark-labs/wireshark-traces.zip and extract the file tcp-ethereal-trace-1. The traces in this zip file were collected by Wireshark running on one of the author’s computers, while performing the steps indicated in the Wireshark lab. Once you have downloaded the trace, you can load it into Wireshark and view the trace using the File pull down menu, choosing Open, andthen selecting the tcp-ethereal-trace-1 trace file.2. A first look at the captured traceBefore analyzing the behavior of the TCP connection in detail, let’s take a high level view of the trace.•First, filter the packets displayed in the Wireshark window by entering “tcp”(lowercase, no quotes, and don’t forget to press return after entering!) into thedisplay filter specification window towards the top of the Wireshark window. What you should see is series of TCP and HTTP messages between your computer and . You should see the initial three-way handshake containing a SYN message. You should see an HTTP POST message and a series of “HTTP Continuation” messages being sent from your computer to . Recall from our discussion in the earlier HTTP Wireshark lab, that is no such thing as an HTTP Continuation message – this is Wireshark’s way of indicating that there are multiple TCP segments being used to carry a single HTTP message. You should also see TCP ACK segments being returned from to your computer.Answer the following questions, by opening the Wireshark captured packet file tcp-ethereal-trace-1 in /wireshark-labs/wireshark-traces.zip (that is download the trace and open that trace in Wireshark; see footnote 2). Whenever possible, when answering a question you should hand in a printout of the packet(s) within the trace that you used to answer the question asked. Annotate the printout to explain your answer. To print a packet, use File->Print, choose Selected packet only, choose Packet summary line, and select the minimum amount of packet detail that you need to answer the question.1.What is the IP address and TCP port number used by the client computer (source)that is transferring the file to ? To answer this question, it’sprobably easiest to select an HTTP message and explore the details of the TCPpacket used to carry this HTTP message, using the “details of the selected packet header window” (refer to Figure 2 in the “Getting Started with Wireshark” Lab if you’re uncertain about the Wireshark windows).2.What is the IP address of ? On what port number is it sendingand receiving TCP segments for this connection?If you have been able to create your own trace, answer the following question:3.What is the IP address and TCP port number used by your client computer(source) to transfer the file to ?Since this lab is about TCP rather than HTTP, let’s change Wireshark’s “listing of captured packets” window so that it shows information about the TCP segments containing the HTTP messages, rather than about the HTTP messages. To have Wireshark do this, select Analyze->Enabled Protocols. Then uncheck the HTTP box and select OK. You should now see an Wireshark window that looks like:This is what we’re looking for - a series of TCP segments sent between your computer and . We will use the packet trace that you have captured (and/or the packet trace tcp-ethereal-trace-1 in /wireshark-labs/wireshark-traces.zip; see footnote 2) to study TCP behavior in the rest of this lab.3. TCP BasicsAnswer the following questions for the TCP segments:4.What is the sequence number of the TCP SYN segment that is used to initiate theTCP connection between the client computer and ? What is itin the segment that identifies the segment as a SYN segment?5.What is the sequence number of the SYNACK segment sent by to the client computer in reply to the SYN? What is the value of theACKnowledgement field in the SYNACK segment? How did determine that value? What is it in the segment that identifies the segment as aSYNACK segment?6.What is the sequence number of the TCP segment containing the HTTP POSTcommand? Note that in order to find the POST command, you’ll need to dig into the packet content field at the bottom of the Wireshark window, looking for asegment with a “POST” within its DATA field.7.Consider the TCP segment containing the HTTP POST as the first segment in theTCP connection. What are the sequence numbers of the first six segments in theTCP connection (including the segment containing the HTTP POST)? At whattime was each segment sent? When was the ACK for each segment received?Given the difference between when each TCP segment was sent, and when itsacknowledgement was received, what is the RTT value for each of the sixsegments? What is the EstimatedRTT value (see page 249 in text) after thereceipt of each ACK? Assume that the value of the EstimatedRTT is equal to the measured RTT for the first segment, and then is computed using theEstimatedRTT equation on page 249 for all subsequent segments.Note: Wireshark has a nice feature that allows you to plot the RTT foreach of the TCP segments sent. Select a TCP segment in the “listing ofcaptured packets” window that is being sent from the client to the server. Then select: Statistics->TCP Stream Graph->Round Trip Time Graph.8.What is the length of each of the first six TCP segments?39.What is the minimum amount of available buffer space advertised at the receivedfor the entire trace? Does the lack of receiver buffer space ever throttle thesender?10.Are there any retransmitted segments in the trace file? What did you check for (inthe trace) in order to answer this question?11.How much data does the receiver typically acknowledge in an ACK? Can youidentify cases where the receiver is ACKing every other received segment (seeTable 3.2 on page 257 in the text).12.What is the throughput (bytes transferred per unit time) for the TCP connection?Explain how you calculated this value.3 The TCP segments in the tcp-ethereal-trace-1 trace file are all less that 1460 bytes. This is because the computer on which the trace was gathered has an Ethernet card that limits the length of the maximum IP packet to 1500 bytes (40 bytes of TCP/IP header data and 1460 bytes of TCP payload). This 1500 byte value is the standard maximum length allowed by Ethernet. If your trace indicates a TCP length greater than 1500 bytes, and your computer is using an Ethernet connection, then Wireshark is reporting the wrong TCP segment length; it will likely also show only one large TCP segment rather than multiple smaller segments. Your computer is indeed probably sending multiple smaller segments, as indicated by the ACKs it receives. This inconsistency in report edsegment lengths is due to the interaction between the Ethernet driver and the Wireshark software. We recommend that if you have this inconsistency, that you perform this lab using the provided trace file.4. TCP congestion control in actionLet’s now examine the amount of data sent per unit time from the client to the server. Rather than (tediously!) calculating this from the raw data in the Wireshark window, we’ll use one of Wireshark’s TCP graphing utilities - Time-Sequence-Graph(Stevens) - to plot out data.•Select a TCP segment in the Wireshark’s “listing of captured-packets” window.Then select the menu : Statistics->TCP Stream Graph-> Time-Sequence-Graph(Stevens). You should see a plot that looks similar to the following plot,which was created from the captured packets in the packet trace tcp-ethereal-trace-1 in /wireshark-labs/wireshark-traces.zip (seefootnote 2):Here, each dot represents a TCP segment sent, plotting the sequence number ofthe segment versus the time at which it was sent. Note that a set of dots stackedabove each other represents a series of packets that were sent back-to-back by the sender.Answer the following questions for the TCP segments the packet trace tcp-ethereal-trace-1 in /wireshark-labs/wireshark-traces.zipe the Time-Sequence-Graph(Stevens) plotting tool to view the sequencenumber versus time plot of segments being sent from the client to the server. Can you identify where TCP’s slowstart phase begins and ends, and where congestion avoidance takes over? Comment on ways inwhich the measured data differs from the idealized behavior of TCP that we’ve studied in the text.14.Answer each of two questions above for the trace that you have gathered whenyou transferred a file from your computer to 。
Wireshark抓包分析TCP.IP.UDP.ICMP报文格式(移动互联网方向)
Wireshark抓包分析TCP.IP.UDP.ICMP报⽂格式(移动互联⽹⽅向)TCP 报⽂格式分析:TCP 报⽂段的报头有 10 个必需的字段和 1 个可选字段。
报头⾄少为 20 字节。
1)源端⼝(16位):标识发送报⽂的计算机端⼝或进程。
⼀个 TCP 报⽂段必须包括源端⼝号,使⽬的主机知道应该向何处发送确认报⽂。
2)⽬的端⼝(16位):标识接收报⽂的⽬的主机的端⼝或进程。
由抓包数据可得源端⼝号为12762,⽬的端⼝号为803)序号(也叫序列号)(32位):⽤于标识每个报⽂段,使⽬的主机可确认已收到指定报⽂段中的数据。
当源主机⽤于多个报⽂段发送⼀个报⽂时,即使这些报⽂到达⽬的主机的顺序不⼀样,序列号也可以使⽬的主机按顺序排列它们。
在建⽴连接时发送的第⼀个报⽂段中,双⽅都提供⼀个初始序列号。
TCP 标准推荐使⽤以 4ms 间隔递增 1 的计数器值作为这个初始序列号的值。
使⽤计数器可以防⽌连接关闭再重新连接时出现相同的序列号。
序列号表达达到2^32 - 1后⼜从0开始,当建⽴⼀个新的连接时,SYN标志为1,系列号将由主机随机选择⼀个顺序号由图可得现序列号为25e4d8a84)确认号(32位):⽬的主机返回确认号,使源主机知道某个或⼏个报⽂段已被接收。
如果 ACK 控制位被设置为 1,则该字段有效。
确认号等于顺序接收到的最后⼀个报⽂段的序号加 1,这也是⽬的主机希望下次接收的报⽂段的序号值。
返回确认号后,计算机认为已接收到⼩于该确认号的所有数据。
由图可得现确认号为59eafa0c5)数据偏移(⾸部长度)(4位)TCP 报⽂段的数据起始处距离 TCP 报⽂段的起始处有多远,即⾸部长度。
由于 TCP 报头的长度随 TCP 选项字段内容的不同⽽变化,因此报头中包含⼀个指定报头字段的字段。
该字段以 32 ⽐特为单位,所以报头长度⼀定是 32 ⽐特的整数倍,有时需要在报头末尾补 0 。
由抓包图有偏移量在0x50中,占4bit,0x50转化为⼆进制数0101 0000 所以偏移量是 0101=5,所以TCP报⽂⾸部长度为5* 4 = 20字节。
Wireshark抓包实验
Wireshark抓包实验⼀、实验名称利⽤Wireshark抓包并分析 TCP/IP 协议⼆、实验⽬的通过实验,了解和掌握报⽂捕获⼯具 Wireshark 的使⽤⽅法和基本特点,使⽤ Wireshark 捕获⽹络报⽂,并分析各种⽹络协议的报⽂格式和⼯作过程。
三、实验内容使⽤ Wireshark 捕获⽹络报⽂,分析以太⽹、ARP、IP、TCP、DNS 和 HTTP 等协议的报⽂格式和⼯作过程。
四、实验步骤DNS分析在 cmd 下运⾏:nslookup –type=Anslookup –type=NS nslookup –type=MX nslookup –type=A 然后⽤Wireshark捕获报⽂并分析DNS和UDP协议的报⽂格式和⼯作过程。
ICMP分析在cmd下运⾏pingtracert然后⽤Wireshark捕获报⽂并分析 ICMP 报⽂格式和⼯作过程。
TCP/IP分析a) 在浏览器输⼊ ⽹址后,然后⽤ Wireshark 捕获报⽂并分析HTTP,TCP,IP,ARP和以太⽹等协议的报⽂格式和⼯作过程。
b) 运⾏各⾃编写的 UDP 和 TCP 客户/服务器程序并进⾏抓包分析。
五、实验结果及分析(⼀)DNS分析通过ipconfig命令查看IP、⽹关地址IP地址192.168.43.217默认⽹关192.168.43.1DNS报⽂格式DNS分析⼤体相同,就选择其⼀进⾏分析1.在cmd下运⾏nslookup -type=A ⾮权威应答:110.53.188.133 113.247.230.248 202.197.9.133应答服务器地址为192.168.43.1,为默认⽹关地址利⽤wireshark进⾏抓包分析,筛选DNS报⽂,本次运⾏有4个DNS报⽂,可以看出对应请求包和响应包的源IP与⽬的IP刚好相反。
Query这是⼀个请求报⽂。
⾸先主机发送⼀个 DNS 报⽂。
DNS 采⽤ UDP 协议⽀持。
wireshark抓包实验之TCP(陕师大)
实验六 Wireshark Lab: TCP一、实验目的1.通过wireshark 抓包理解应用层TCP 协议。
二、实验器材1.PC 机电脑一台。
2.Wireshark 软件。
三、实验内容1.依照Wireshark Lab 提供的实验步骤完成实验。
2.回答实验中的问题。
四、实验操作实践与步骤2. A first look at the captured trace1. What is the IP address and TCP port number used by the client computer (source) that is transferring the file to ? To answer this question, it’s probably easiest to select an HTTP message and explore the details of the TCP packet used to carry this HTTP message, using the “details of the selected packet header window”2. What is the IP address of ? On what port number is itsending and receiving TCP segments for this connection? Source IP address :129.168.1.102Source TCP portnumber :1161Destination IP address :128.119.245.12Destination TCPport number:80If you have been able to create your own trace, answer the following question:3. What is the IP address and TCP port number used by your client computer (source) to transfer the file to ?3. TCP Basics4. (1)What is the sequence number of the TCP SYN segment that is used to initiate the TCP connection between the client computer and ? (2)What is it in the segment that identifies the segment as a SYN segment?(1) SYN sequence number =0(2) What is in the red region of the figure above identifies the segment as a SYN segment.5. (1)What is the sequence number of the SYNACK segment sent by to the client computer in reply to the SYN?(2) What is the value of the ACKnowledgement field in the SYNACK segment? How did determine that value? What is it in the segment that identifies the segment as a SYNACK segment?(1)SYNACK sequence number =0, ACKnowledgement=1(2)ACKnowledgement value= initiate sequence number of the TCP SYN segment+1(3)What is in the red region of the figure above identifies the segment as a SYN segment.6. What is the sequence number of the TCP segment containing the HTTP POST command? Note that in order to find the POST command, you’ll need to dig into the packet content field at the bottom of the Wireshark window, looking for a segment with a “POST” wi thin itsDATA field.The sequence number of the TCP segment containing the HTTP POST command is 1.7. Consider the TCP segment containing the HTTP POST as the first segment in the TCP connection. (1)What are the sequence numbers of the first six segments in the TCP connection (including the segment containing the HTTP POST)? (2)At what time was each segment sent? When was the ACK for each segment received?(3) Given the difference between when each TCP segment was sent, and when its acknowledgement was received, what is the RTT value for each of the six segments?(4) What is the EstimatedRTT value (see page 249 in text) after the receipt of each ACK? (5)Assume that the value of the EstimatedRTT is equal to the measured RTT for the first segment, and then is computed using the EstimatedRTT equation on page 249 for allsubsequent segments.Note: Wireshark has a nice feature that allows you to plot the RTT for each of the TCP segments sent. Select a TCP segment in the “listing of captured packets” window that is being sent from the client to the server. Then select: Statistics->TCP Stream Graph- >Round Trip Time Graph(1) The first sixsegments are the No.4, 5, 7, 8, 10, and 11 segments.(circled in red)The sequence numbers of them respectively are1, 566, 2026, 3486, 4946, 6406, 7866.(2)They were respectively sent at the time circled int the figure bellow.(3)ACK received time are given in the figure bellow:(4)RTT value for each of the six segmentsSent time ACK received time RTT value Segment1 0.026477 0.053937 0.02746 Segment2 0.041737 0.077294 0.035557 Segment3 0.054026 0.124085 0.070059 Segment4 0.054690 0.169118 0.11443(5)EstimatedRTT = 0.875 * EstimatedRTT + 0.125 * SampleRTT EstimatedRTT after the receipt of the ACK of segment 1: EstimatedRTT = RTT for Segment 1 = 0.02746 secondsegment 2:EstimatedRTT = 0.875 * 0.02746 + 0.125 * 0.035557 = 0.0285 segment 3:EstimatedRTT = 0.875 * 0.0285 + 0.125 * 0.070059 = 0.0337 segment 4:EstimatedRTT = 0.875 * 0.0337+ 0.125 * 0.11443 = 0.0438 segment 5:EstimatedRTT = 0.875 * 0.0438 + 0.125 * 0.13989 = 0.0558 segment 6:EstimatedRTT = 0.875 * 0.0558+ 0.125 * 0.18964 = 0.0725Figure: Round Trip Time Graph8. What is the length of each of the first six TCP segments?The length of the first TCP segments (containing the HTTP POST) is 566 bytes. The length of each of the other five TCP segments is 1460 bytes.9. What is the minimum amount of available buffer space advertised at the received for the entire trace? Does the lack of receiver buffer space ever throttle the sender?The minimum amount of available buffer space at advertised at for the entire trace is 5840 bytes, which shows in the first acknowledgement (No.2 segment )from the server. This receiver window grows steadily until a maximum receiver buffer size of 62780bytes. The sender is never throttled due to lacking of receiver buffer space by inspecting this trace.Figure : Minimum receive window (packet No.2)10. Are there any retransmitted segments in the trace file? What did you check for (in the trace)in order to answer the question?There is no retransmitted segments in the trace file.In order to answer the question , I checked for the sequence numbers of the TCP segments in the trace file. In the Time-Sequence-Graph (Stevens) of this trace, all sequence numbers from 192.168.1.102 to 128.119.245.12 are increasing linear and monotonically. If there is a retransmitted segment, the Time-Sequence-Graph (Stevens) should be different from what we see.11.(1) How much data does the receiver typically acknowledge in an ACK?(2) Can you identify cases where the receiver is ACKing every other received segment (see Table 3.2 on page 257 in the text).The receiver typically acknowledged sequence numbers of the ACKs are listed in the following table.Acknowledged sequence number Acknowledged data SegmentnumberACK16 566 566ACK29 2026 1460ACK312 3486 1460ACK414 4946 1460ACK515 6406 146012. What is the throughput (bytes transferred per unit time) for the TCP connection? Explain how you calculated this value.The TCP connection started to transmit data at segment 4,and end in segment 202. We can see from the figure bellow:data1=1 byte t1=0.026477data2=164091 bytes t2=5.455830total data=164091-1=164090 bytesit takes time: total time=5.455830-0.026477=5.429353 secondsSo the throughput for the TCP connection is calculated as164090/5.4294353= 30.222 KByte/sec13. Use the Time-Sequence-Graph(Stevens) plotting tool to view the sequence number versus time plot of segments being sent from the client to the server. Can you identify where TCP’s slow start phase begins and ends, and where congestion avoidance takes over?Comment on ways in which the measured data differs from the idealized behavior of TCP that we’ve studied in the text.We can see from the figure above(Time-Sequence-Graph(Stevens)) that the TCP Slow Start begins at the start of the connection.The identification of the TCP slow start phase and congestion avoidance phase depends on the value of the congestion window size of this TCP sender. So once we know the congestion window size of this TCP sender, we can tell easily where TCP’s slow ends and where congestion avoidance takes over.When answering the previous question, we can know that the TCP window size is larger than 8192 Bytes.But there is no data sent more than 8192 Bytes. It indicates before the end of the start phase,the application already stops transmitting . That is to say, the TCP’s slow ends and congestion avoidance haven’t taken place.五、实验结论总的来说,这一次实验做的很痛苦,因为一开始问题回答不出来。
wireshark抓包分析——TCPIP协议
wireshark抓包分析——TCPIP协议本⽂来⾃当我们需要跟踪⽹络有关的信息时,经常会说“抓包”。
这⾥抓包究竟是什么?抓到的包⼜能分析出什么?在本⽂中以TCP/IP协议为例,简单介绍TCP/IP协议以及如何通过wireshark抓包分析。
Wireshark 是最著名的⽹络通讯抓包分析⼯具。
功能⼗分强⼤,可以截取各种⽹络封包,显⽰⽹络封包的详细信息。
Wireshark下载安装,略。
注意,若在Windows系统安装Wireshark,安装成功后可能会出现Wireshark的两个图标,⼀个是Wireshark(中⽂版);另外⼀个是Wireshark Legacy (英⽂版)。
下⾯的内容会以Wireshark Legacy为例介绍。
打开Wireshark,开始界⾯如下:Wireshark捕获的是⽹卡的⽹络包,当机器上有多块⽹卡的时候,需要先选择⽹卡。
开始界⾯中的Interface List,即⽹卡列表,选择我们需要的监控的⽹卡。
点击Capture Options,选择正确的⽹卡,然后点击"Start"按钮, 开始抓包。
我们打开浏览器输⼊任意http⽹址,连接再关闭,⽐如:。
然后,我们回到Wireshark界⾯,点击左上⾓的停⽌按键。
查看此时Wireshark的抓包信息。
在看抓包信息之前,先简单介绍下Wireshark界⾯的含义。
其中,封包列表的⾯板中显⽰编号、时间戳、源地址、⽬标地址、协议、长度,以及封包信息。
封包详细信息是⽤来查看协议中的每⼀个字段。
各⾏信息分别对应TCP/IP协议的不同层级。
以下图为例,分别表⽰:传输层、⽹络层、数据链路层、物理层,⼀共四层。
如果有应⽤层数据会显⽰第五层,即⼀共会出现五层。
每⼀层都有⼀个字段指向上⼀层,表明上⼀层是什么协议。
这⼤概是因为发包的时候会在数据上依次加上应⽤层、传输层、⽹络层、链路层的头部,但是对⽅收到数据包后是从最底层(链路层)开始层层剥去头部解包的,所以在每层上有⼀个字段指向上层,表明上层的协议,对⽅就知道下⼀步该怎么解包了。
Wireshark抓包实验报告.
第一次实验:利用Wireshark软件进行数据包抓取1.3.2 抓取一次完整的网络通信过程的数据包实验一,实验目的:通过本次实验,学生能掌握使用Wireshark抓取ping命令的完整通信过程的数据包的技能,熟悉Wireshark软件的包过滤设置和数据显示功能的使用。
二,实验环境:操作系统为Windows 7,抓包工具为Wireshark.三,实验原理:ping是用来测试网络连通性的命令,一旦发出ping命令,主机会发出连续的测试数据包到网络中,在通常的情况下,主机会收到回应数据包,ping采用的是ICMP协议。
四,验步骤:1.确定目标地址:选择作为目标地址。
2.配置过滤器:针对协议进行过滤设置,ping使用的是ICMP协议,抓包前使用捕捉过滤器,过滤设置为icmp,如图 1- 1图 1-13.启动抓包:点击【start】开始抓包,在命令提示符下键入ping , 如图 1-2图 1-2停止抓包后,截取的数据如图 1-3图 1-34,分析数据包:选取一个数据包进行分析,如图1- 4图1-4每一个包都是通过数据链路层DLC协议,IP协议和ICMP协议共三层协议的封装。
DLC协议的目的和源地址是MAC地址,IP协议的目的和源地址是IP地址,这层主要负责将上层收到的信息发送出去,而ICMP协议主要是Type和Code来识别,“Type:8,Code:0”表示报文类型为诊断报文的请求测试包,“Type:0,Code:0”表示报文类型为诊断报文类型请正常的包。
ICMP提供多种类型的消息为源端节点提供网络额故障信息反馈,报文类型可归纳如下:(1)诊断报文(类型:8,代码0;类型:0代码:0);(2)目的不可达报文(类型:3,代码0-15);(3)重定向报文(类型:5,代码:0--4);(4)超时报文(类型:11,代码:0--1);(5)信息报文(类型:12--18)。
1.4.1,TCP协议的分析实验一,实验目的:通过本次实验,掌握使用Wireshark抓取TCP协议的数据包的技能,能够在深入分析“TCP的三次握手”,TCP的四次挥手协议在网络数据流的基础上,进一步提高理论联系实践的能力。
使用wireshark进行抓包分析 实验报告
二.实验工具wireshark软件三.实验主要过程与结果本次实验使用了wireshark抓包软件对QQ的协议数据进行了分析。
1、首先打开wireshark,登录QQ2、然后点击开始抓包,给好友发送消息3、最后停止抓包,分析协议数据结果:停止抓包后,可以看到wireshark的页面如下,分为了三个区域:从上到下依次为数据包列表,数据包细节和数据包字节。
源地址为120.204.17.118,目的地址为172.17.62.0即为本机的地址)。
从数据包细节窗口可以看出总共有五层,从下到上依次为应用层,运输层,网络层,数据链路层,物理层。
分别对其不同层进行分析。
四、分析讨论1、应用层应用层是五层协议体系结构中的最高层,其任务是通过应用进程间的交互来完成特定网络应用。
本实验使用的应用进程为QQ,从下图中可以看出QQ所使用的协议为OICQ协议,其中里面包含了交互数据,即为报文。
在数据包细节中OICQ协议中的第五行,可以看到自己的QQ号(302702230)。
选中最后一行的DaTa可以看到传输的数据,即为报文。
2、运输层运输层的任务就是负责向两台主机中进程之间的通信提供通用的数据传输服务,应用进程利用该服务传送应用层报文。
从下图可以看到运输层所使用的协议为UDP协议,UDP协议提供无连接的、尽最大努力的数据传输服务(不保证数据传输的可靠性),其数据的单位是用户数据报。
图中所选中的数据部分是运输层给数据加的报头。
其源端口号为8000,目的端口号为4009,数据包字节长度为87。
UDP协议的第四行表示检验和显示为验证禁用,不能验证,如下图。
3、网络层网络层负责为分组交换网上的不同主机提供通信服务。
在发送数据时,网络层把运输层产生的报文段或用户数据报封装成分组或包进行传送。
从图中可以看出可以看到IP的版本号为4;IP头的长度是20字节,所以从图中可以看出第一个数45,即代表版本号和IP头的长度;首部和载荷的总长度是107字节(0x006b),00在前,6b在后,说明进行网络传输的时候是先传输高位再传输低位,即高字节数据在低地址,低字节数据在高地址,从图中可以看出是00 6b;TTL(存活时间)域的值是54;协议为UDP。
Wireshark数据抓包分析之传输层协议(TCP协议)
Wireshark数据抓包分析之传输层协议(TCP协议)1.TCP协议的由来UDP协议,实验⾮常简单,并且容易实现。
但是其可靠性较差,⼀旦将数据包发出,将⽆法知道对⽅是否收到。
为了解决这个问题,TCP协议就诞⽣了。
使⽤TCP协议,可以提供⽹络的安全性。
因为使⽤TCP协议传输数据时,每发送⼀个数据包都要求确认。
如果有⼀个数据包丢失,就收不到确认包,发送⽅就知道应该重发这个数据包。
这样,TCP协议就保证了数据的安全性。
2.TCP端⼝TCP端⼝就是为TCP协议通信提供服务的窗⼝。
所有TCP通信都会使⽤源端⼝和⽬的端⼝,⽽这些可以在每个TCP头中找到。
端⼝就像是⽼式电话机上的接⼝,⼀个总计操作员会监视着⼀个⾯板上的指⽰灯和插头。
当指⽰灯亮起的时候,它就会链接这个呼叫者,问它想要和谁通话,然后插⼀根电缆线将它和它的⽬的地址链接起来。
每次呼叫都需要有⼀个源端⼝(呼叫者)和⽬的端⼝(接收者)。
TCP端⼝⼤概就是这样⼯作的。
为了能够将数据传输到远程服务器或者设备的特定应⽤中去,TCP数据包必须知道远程服务所监听的端⼝。
如果想试着链接⼀个不同于所设置的端⼝,那么这个通信就会失败。
这个序列中的源端⼝并不⼗分重要,所以可以随机选择。
远程服务器也可以很简单的从发送过来的原始数据中得到这个端⼝。
如下图所⽰,在图中列举两种服务使⽤的TCP端⼝。
图中表⽰客户端与Web服务器和邮件服务器的⼀个通信。
从该图中,可以看到客户端与不同服务器建⽴连接时,使⽤的源端⼝和⽬标端⼝都不同。
在使⽤TCP进⾏通信的时候,有65535个端⼝可供使⽤,并通常将这些端⼝分成两个部分,如下所⽰:1~1023:是标准端⼝组(忽略掉被预留的0),特定服务会⽤到这些通常位于标准端⼝分组中的标准端⼝。
1024~65535:是临时端⼝组(尽管⼀些操作对此有着不同的定义),当⼀个服务想在任意时间使⽤端⼝进⾏通信的时候,操作系统都会随机选择这个源端⼝,让这个通信使⽤唯⼀的源端⼝。
计算机网络实验
陕西师范大学计算机网络实验报告实验三 HTTP一、实验目的1.通过使用wireshark软件掌握基本的GET,HTTP /响应交互和消息格式2.掌握探索HTTP协议的方法。
二、实验器材1.PC机电脑一台。
2.下载wireshark软件并安装三、实验操作步骤及结果1. The Basic HTTP GET/response interaction1 Start up your web browser.2. Start up the Wireshark packet sniffer, as described in the Introductory lab (but don’t yet begin packet capture). Enter “http” (just the letters, not the quotation marks) in the display-filter-specification window, so that only captured HTTP messages will be displayed later in the packet-listing window. (We’re only interested in the HTTP protocol here, and don’t want to see the clutter of all captured packets).3. Wait a bit more than one minute (we’ll see why shortly), and then begin Wireshark packet capture.4. Enter the following to your browser/wireshark-labs/HTTP-wireshark-file1.htmlYour browser should display the very simple, one-line HTML file.5. Stop Wireshark packet capture.实验截图如下:1. Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running?我的浏览器上运行的HTTP版本是1.1,在版本为的HTTP服务器上运行。
WireShark网络抓包实验
计算机网络管理实验报告专业:学号:姓名:指导老师:日期:一.实验目的:1.了解SNMP网络管理架构。
2.掌握和理解MIB-2功能组的使用3.能够使用Wireshark执行基本的包的捕获。
二.实验工具:wiresharkSnmpB软件WireShark是一款很好的抓包工具,复习一下网络基础知识,尤其是数据包的格式。
三.实验步骤1.使用SnmpB发送包填入搜索网段,然后查找选择目标网络然后就可以利用Snmp发送包。
2.安装WireShark,对Snmp发送包进行捕获。
3.打开WireShark,选择"Capture>>Interfaces",选择自己的网卡(物理网卡,如果装了,VM或是VPN软件,会产生很多虚拟网卡,但软件不使用时,流量是零)。
选择"Start"开始监控流量。
4.抓包分析。
打开一个网页然后选择"Stop The running live capture"停止抓包。
TCP协议分析,抓取一个TCP报文目的MAC地址:00 25 86 28 89 f6源地址MAC: 00 26 18 ce d9 19类型:08 00 表示上次使用的是IP数据报IP版本 Ipv4 首部长度:20 区分服务:00 ip报文长度: 00 28 (40)标识:65 5a 标志、片偏移:40 00 生产时间:40协议:06 这里表示数据报携带的数据时使用的TCP协议首部检验和:00 00源地址ip: c0 a8 01 64目的地址ip:3d 93 4c 3f源端口:14 a3 目的端口:1f 90 序号:2f b8 f0 ee确认号:db 5b 4c 50UDP报文分析目的MAC地址:00 25 86 28 89 f6源地址MAC: 00 26 18 ce d9 19类型:08 00 表示上次使用的是IP数据报IP版本 Ipv4 首部长度:20 区分服务:00 ip报文长度: 00 28 (40)标识:65 5a 标志、片偏移:40 00 生产时间:40协议:11 这里表示数据报携带的数据时使用的UDP协议首部检验和:00 00源IP地址:c0 a8 01 64目的地址ip:79 e4 cd 1e四.实验总结作为一名网络工程专业的学生,计算机网络是我们的学业的重中之重。
实验4-捕获并分析TCP数据包和TCP三次握手及四次挥手过程
实验四捕获并分析TCP数据包和TCP三次握手和四次挥手过程一、实验目的通过网络嗅探器软件对网络数据进行监听和分析,加深对计算机网络中各层协议数据单元PDU的形象理解。
二、实验内容1、利用网络嗅探器软件(例如Iris、Sniffer、Ethereal、 wireshark等),获取TCP数据包,记录并分析各字段的含义。
2、打开一个网站,截取TCP数据包(至少三个),分析TCP三次握手建立连接和四次挥手释放连接的过程。
三、实验步骤1、安装数据包捕获软件wireshark。
2、启动捕获软件。
(1)开始捕获数据报:(2)打开一个网站,例:(3)对捕获的TCP数据包进行分析,并保存(4)对捕获的TCP三次握手建立连接的几个数据包进行分析,分别说明各数据包代表的意义和所属的三次握手的第几次。
四、实验分析1、设置显示过滤,只显示源地址是本机的http数据包,说明如何进行设置?答:若要设置只显示源地址是本机的http数据包,需使用以下ip.src==本机IP && http 2、点开软件捕获界面中包详细信息栏的TCP数据包:若想查看TCP数据包的内容,需点击前面的加号,则显示TCP报文段各字段的结构如下图所示:对照课本P202页:TCP报文段的结构图,如下图示:分析并记录说明,所捕获的数据包的在运输层TCP报文段中各字段的具体信息:①源端口号:49896。
每一个应用进程在运输层都对应一个端口号。
端口是运输层与应用层的服务接口。
运输层的复用和分用功能都要通过端口才能实现。
②目的端口号:80。
说明发送方请求的是一个web服务(http).③序号:0。
为了对发送的报文段进行可靠传输,对每个发送的报文段的第一个字节都进行编号,称为序号。
例如:一个报文段的序号值为301,携带的数据长度100字节;则下一个报文段的序号为401.④确认号:0。
为了告诉发送方,到目前为止,接收方按顺序接收的报文段达到多少,将下一个期望接收的报文段的第一个字节的编号作为确认号发给发送方。
Wireshark抓包分析TCP协议
Wireshark抓包分析TCP协议之前一直听别人说Wireshark这个抓包软件,Leelom也跟我提过说面试的时候会问这些东西。
今天呢,参考别人的博文,结合抓包,将TCP/IP协议进行一些浅显的分析。
1. HTTP协议基本特征更加具体的说明需要重新写一篇博客来看。
参考基础认知TCP(Transmission Control Protocol,传输控制协议)是面向连接的、可靠的、基于字节流的在传输层上的通信协议。
这里想一下UDP,是无连接的、不可靠的(所以就像之前提到的一样,无连接的快节省时间,不用连接建立的时间)。
TCP/IP の 4层模型数据包封装情况TCP/IP分层结构跟OSI(Open System Interconnection)分7层不同。
如上面的图中,TCP/IP 协议下分为4层:应用层、传输层、网络层、数据链路层。
•应用层:向用户提供常用的应用程序。
比如电子邮件、文件传输、远程登录等。
TELNET 会话提供了基于字符的虚拟终端,FTP使用 FTP协议来提供网络内机器间的文件拷贝功能。
•传输层:传输层提供两台主机之间端到端的通信。
所谓的TCP/UDP协议就是跑在这一层。
•网络层:处理分组在网络中的活动。
可以理解为IP路由这些。
•链路层:链路层负责处理下层物理层的物理接口细节。
主要目的有: \ 1. 为上层IP模块接收和发送IP数据报 \ 2. 为ARP模块发送请求和完成接收 \ 3.为RARP模块。
层级功能图封装封装这个事情就好像寄快递一样。
之前上计网课那个张洪涛就是这么举例子的。
报文封装注意上图中的 appl 首部是说 application 层首部的意思。
按照上图一层层封装,直到经过以太网封装之后,就要通过网线或者其他的传输介质将此封装好的报文发送到另一端去。
另一端收到之后再一层层的把封装头剥离,最终拿到用户数据。
这里我们要明白一点就是上层对下层不负责,下层对上层隐身。
TCP/IP这里可以做这样的一个理解,就是TCP/IP协议是说二者协同一起工作。
tcp抓包Wireshark使用
tcp抓包Wireshark使用TCP抓包是网络管理员和分析师中常用的一种技术,用于捕获网络上的数据包并进行分析。
Wireshark是一个流行的开源网络协议分析工具,可以在多个平台上使用。
安装完成后,启动Wireshark。
打开Wireshark后,将弹出一个对话框,询问您要捕获哪个网络接口上的数据包。
在对话框的顶部,有一个下拉菜单列出可用的网络接口。
选择要进行抓包的网络接口。
如果您不确定应使用哪个接口,请选择默认接口。
在选择接口后,点击“Start”按钮开始抓包。
此时,Wireshark将开始捕获网络接口上的数据包。
实时捕获数据包后,Wireshark将在主窗口中显示捕获的数据包列表。
每个数据包的详细信息(如源和目的IP地址、源和目的端口等)将显示在列表中。
您可以通过单击列表中的数据包以查看其详细信息。
Wireshark提供了多个选项卡,用于查看和分析数据包的不同方面,如帧、协议、源和目的信息等。
除了捕获数据包外,Wireshark还提供了许多其他功能,如过滤数据包、统计和分析传输速率等。
为了更好地理解数据包的内容和流量,您可以使用Wireshark的过滤器功能。
过滤器允许您仅显示满足特定条件的数据包,从而减少对捕获到的大量数据包的处理。
要使用过滤器,请在Wireshark的过滤栏中键入特定的过滤条件,并按“Enter”键应用过滤器。
Wireshark将只显示满足过滤条件的数据包。
Wireshark还提供了许多高级功能,如统计和图形化分析网络流量、导出数据包等。
这些功能可以帮助您更好地理解网络中的通信模式和性能问题。
在分析和故障排除网络问题时,Wireshark往往是一项强大的工具。
它可以帮助您查看和分析数据包中的错误、重传、丢包等,以及识别与网络性能相关的问题。
总结一下,Wireshark是一个功能强大的网络协议分析工具,可用于捕获和分析网络中的数据包。
通过了解如何使用Wireshark来执行TCP抓包操作,您可以更好地了解和维护网络性能。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验六 Wireshark Lab: TCP一、实验目的1.通过wireshark 抓包理解应用层TCP 协议。
二、实验器材1.PC 机电脑一台。
2.Wireshark 软件。
三、实验内容1.依照Wireshark Lab 提供的实验步骤完成实验。
2.回答实验中的问题。
四、实验操作实践与步骤2. A first look at the captured trace1. What is the IP address and TCP port number used by the client computer (source) that is transferring the file to ? To answer this question, it’s probably easiest to select an HTTP message and explore the details of the TCP packet used to carry this HTTP message, using the “details of the selected packet header window”2. What is the IP address of ? On what port number is itsending and receiving TCP segments for this connection? Source IP address :129.168.1.102Source TCP portnumber :1161Destination IP address :128.119.245.12Destination TCPport number:80If you have been able to create your own trace, answer the following question:3. What is the IP address and TCP port number used by your client computer (source) to transfer the file to ?3. TCP Basics4. (1)What is the sequence number of the TCP SYN segment that is used to initiate the TCP connection between the client computer and ? (2)What is it in the segment that identifies the segment as a SYN segment?(1) SYN sequence number =0(2) What is in the red region of the figure above identifies the segment as a SYN segment.5. (1)What is the sequence number of the SYNACK segment sent by to the client computer in reply to the SYN?(2) What is the value of the ACKnowledgement field in the SYNACK segment? How did determine that value? What is it in the segment that identifies the segment as a SYNACK segment?(1)SYNACK sequence number =0, ACKnowledgement=1(2)ACKnowledgement value= initiate sequence number of the TCP SYN segment+1(3)What is in the red region of the figure above identifies the segment as a SYN segment.6. What is the sequence number of the TCP segment containing the HTTP POST command? Note that in order to find the POST command, you’ll need to dig into the packet content field at the bottom of the Wireshark window, looking for a segment with a “POST” wi thin itsDATA field.The sequence number of the TCP segment containing the HTTP POST command is 1.7. Consider the TCP segment containing the HTTP POST as the first segment in the TCP connection. (1)What are the sequence numbers of the first six segments in the TCP connection (including the segment containing the HTTP POST)? (2)At what time was each segment sent? When was the ACK for each segment received?(3) Given the difference between when each TCP segment was sent, and when its acknowledgement was received, what is the RTT value for each of the six segments?(4) What is the EstimatedRTT value (see page 249 in text) after the receipt of each ACK? (5)Assume that the value of the EstimatedRTT is equal to the measured RTT for the first segment, and then is computed using the EstimatedRTT equation on page 249 for allsubsequent segments.Note: Wireshark has a nice feature that allows you to plot the RTT for each of the TCP segments sent. Select a TCP segment in the “listing of captured packets” window that is being sent from the client to the server. Then select: Statistics->TCP Stream Graph- >Round Trip Time Graph(1) The first sixsegments are the No.4, 5, 7, 8, 10, and 11 segments.(circled in red)The sequence numbers of them respectively are1, 566, 2026, 3486, 4946, 6406, 7866.(2)They were respectively sent at the time circled int the figure bellow.(3)ACK received time are given in the figure bellow:(4)RTT value for each of the six segmentsSent time ACK received time RTT value Segment1 0.026477 0.053937 0.02746 Segment2 0.041737 0.077294 0.035557 Segment3 0.054026 0.124085 0.070059 Segment4 0.054690 0.169118 0.11443(5)EstimatedRTT = 0.875 * EstimatedRTT + 0.125 * SampleRTT EstimatedRTT after the receipt of the ACK of segment 1: EstimatedRTT = RTT for Segment 1 = 0.02746 secondsegment 2:EstimatedRTT = 0.875 * 0.02746 + 0.125 * 0.035557 = 0.0285 segment 3:EstimatedRTT = 0.875 * 0.0285 + 0.125 * 0.070059 = 0.0337 segment 4:EstimatedRTT = 0.875 * 0.0337+ 0.125 * 0.11443 = 0.0438 segment 5:EstimatedRTT = 0.875 * 0.0438 + 0.125 * 0.13989 = 0.0558 segment 6:EstimatedRTT = 0.875 * 0.0558+ 0.125 * 0.18964 = 0.0725Figure: Round Trip Time Graph8. What is the length of each of the first six TCP segments?The length of the first TCP segments (containing the HTTP POST) is 566 bytes. The length of each of the other five TCP segments is 1460 bytes.9. What is the minimum amount of available buffer space advertised at the received for the entire trace? Does the lack of receiver buffer space ever throttle the sender?The minimum amount of available buffer space at advertised at for the entire trace is 5840 bytes, which shows in the first acknowledgement (No.2 segment )from the server. This receiver window grows steadily until a maximum receiver buffer size of 62780bytes. The sender is never throttled due to lacking of receiver buffer space by inspecting this trace.Figure : Minimum receive window (packet No.2)10. Are there any retransmitted segments in the trace file? What did you check for (in the trace)in order to answer the question?There is no retransmitted segments in the trace file.In order to answer the question , I checked for the sequence numbers of the TCP segments in the trace file. In the Time-Sequence-Graph (Stevens) of this trace, all sequence numbers from 192.168.1.102 to 128.119.245.12 are increasing linear and monotonically. If there is a retransmitted segment, the Time-Sequence-Graph (Stevens) should be different from what we see.11.(1) How much data does the receiver typically acknowledge in an ACK?(2) Can you identify cases where the receiver is ACKing every other received segment (see Table 3.2 on page 257 in the text).The receiver typically acknowledged sequence numbers of the ACKs are listed in the following table.Acknowledged sequence number Acknowledged data SegmentnumberACK16 566 566ACK29 2026 1460ACK312 3486 1460ACK414 4946 1460ACK515 6406 146012. What is the throughput (bytes transferred per unit time) for the TCP connection? Explain how you calculated this value.The TCP connection started to transmit data at segment 4,and end in segment 202. We can see from the figure bellow:data1=1 byte t1=0.026477data2=164091 bytes t2=5.455830total data=164091-1=164090 bytesit takes time: total time=5.455830-0.026477=5.429353 secondsSo the throughput for the TCP connection is calculated as164090/5.4294353= 30.222 KByte/sec13. Use the Time-Sequence-Graph(Stevens) plotting tool to view the sequence number versus time plot of segments being sent from the client to the server. Can you identify where TCP’s slow start phase begins and ends, and where congestion avoidance takes over?Comment on ways in which the measured data differs from the idealized behavior of TCP that we’ve studied in the text.We can see from the figure above(Time-Sequence-Graph(Stevens)) that the TCP Slow Start begins at the start of the connection.The identification of the TCP slow start phase and congestion avoidance phase depends on the value of the congestion window size of this TCP sender. So once we know the congestion window size of this TCP sender, we can tell easily where TCP’s slow ends and where congestion avoidance takes over.When answering the previous question, we can know that the TCP window size is larger than 8192 Bytes.But there is no data sent more than 8192 Bytes. It indicates before the end of the start phase,the application already stops transmitting . That is to say, the TCP’s slow ends and congestion avoidance haven’t taken place.五、实验结论总的来说,这一次实验做的很痛苦,因为一开始问题回答不出来。