TCP实验报告

更新时间:2024-06-15 08:25:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

“TCP/IP技术与应用”

实 验 报 告

实验一 HTTP报文分析

一、实验目的

? 熟悉HTTP的报文格式 ? 熟练Ethereal的使用方法

二、实验环境

? Windows操作系统 ? Ethereal协议分析仪

三、试验要求

1. Basic HTTP GET/response interaction

Open and examine the Ethereal captured packet file http-ethereal-trace-1, and then answer the following questions.

1) Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running? HTTP/1.1,HTTP/1.1

2) What languages (if any) does your browser indicate that it can accept to the server?

Answer:

3) What is the IP address of your computer? Of the gaia.cs.umass.edu server? Answer:192.168.1.102 63.240.76.19

4) What is the status code returned from the server to your browser?

Answer:200 HTTP/1.1 200 OK(text/html) 404 HTTP/1.1 404 Not Found(text/html)

5) When was the HTML file that you are retrieving last modified at the server?

Answer: 6) How many bytes of content are being returned to your browser?

Answer:

7) By inspecting the raw data in the packet content window, do you see any headers within the data

that are not displayed in the packet-listing window? If so, name one.

Answer: Yes

2. The HTTP CONDITIONAL GET/response interaction

Open and examine the Ethereal captured packet file http-ethereal-trace-2, and then answer the following questions.

8) Inspect the contents of the first HTTP GET request from your browser to the server. Do you see an

“IF-MODIFIED-SINCE” line in the HTTP GET? Answer: No

9) Inspect the contents of the server response. Did the server explicitly return the contents of the file?

How can you tell? Answer: Yes,

10) 10. Now inspect the contents of the second HTTP GET request from your browser to the server.

Do you see an “IF-MODIFIED-SINCE:” line in the HTTP GET? If so, what information follows the “IF-MODIFIED-SINCE:” header?

Answer: Yes. Date after Tue,23 Sep 2003 05:35:00 GMT

11) What is the HTTP status code and phrase returned from the server in response to this second HTTP

GET? Did the server explicitly return the contents of the file? Explain. Answer:

NO,因为第一次访问后已经返回,第二次申请时未变

3. Retrieving Long Documents

Open and examine the Ethereal captured packet file http-ethereal-trace-3, and then answer the following questions.

12) How many HTTP GET request messages were sent by your browser? Answer:1

13) How many data-containing TCP segments were needed to carry the single HTTP response?

Answer:4

14) What is the status code and phrase associated with the response to the HTTP GET request? Answer:

15) Are there any HTTP status lines in the transmitted data associated with a TCP induced

“Continuation”? Answer: NO

4. HTML Documents with Embedded Objects

Open and examine the Ethereal captured packet file http-ethereal-trace-4, and then answer the following questions.

16) How many HTTP GET request messages were sent by your browser? To which Internet

addresses were these GET requests sent? Answer: 3,

17) Can you tell whether your browser downloaded the two images serially, or whether they were

downloaded from the two web sites in parallel? Explain.

Answer: Parallel,因为第一次请求图片,未等到回复就继续第二次申请

试验二 TCP 报文分析

一、实验目的

? 熟悉TCP的报文格式 ? 熟练Ethereal的使用方法

二、实验环境

? Windows操作系统 ? Ethereal协议分析仪

三、试验要求

Open and examine the Ethereal captured packet file tcp-ethereal-trace-1, and then answer the following questions.

1. What is the IP address and TCP port number used by the client computer (source) that is

transferring the file to gaia.cs.umass.edu? Answer:

TCP segments for this connection? Answer:

2. What is the IP address of gaia.cs.umass.edu? On what port number is it sending and receiving

3. What is the sequence number of the TCP SYN segment that is used to initiate the TCP

connection between the client computer and gaia.cs.umass.edu? What is it in the segment that identifies the segment as a SYN segment? Answer:0,Flags中SYN为1

4. What is the sequence number of the SYNACK segment sent by gaia.cs.umass.edu to the client

computer in reply to the SYN? What is the value of the ACKnowledgement field in the SYNACK segment? How did gaia.cs.umass.edu determine that value? What is it in the segment that identifies the segment as a SYNACK segment? Answer:

因为上一次seq=0 由Flags中SYN与ACK位为1

5. What is the sequence number of the TCP segment containing the HTTP POST command?

Answer:

6. Consider the TCP segment containing the HTTP POST as the first segment in the TCP

connection. What are the sequence numbers of the first six segments in the TCP connection (including the segment containing the HTTP POST)? At what time was each segment sent? When was the ACK for each segment received? Answer: 编号 1 2 3 4 5 6

7. What is the length of each of the first six TCP segments?

(相对)序列号 1 566 2026 3486 4946 6406 发送时间 0.026477 确认时间 TCP报文长度 585 1480 1480 1480 1480 1480 Answer:585 1480 1480 1480 1480 1480

8. What is the minimum amount of available buffer space advertised at the received for the entire trace?

Answer: 5840

9. How much data does the receiver typically acknowledge in an ACK? Can you identify cases where the receiver is ACKing every other received segment Answer:2个.能

10. What is the throughput (bytes transferred per unit time) for the TCP connection? Explain how

you calculated this value?

Answer:163411/(5.297341-0.041737)

实验三 TCP/IP报文综合分析

一、实验目的

? 熟悉TCP的报文格式 ? 熟练Ethereal的使用方法

二、实验环境

? Windows操作系统 ? Ethereal协议分析仪

三、实验内容及要求

用Ethereal打开文件http-ethereal-trace-1,分析12号分组的原始数据,并回答以下问题:(注: 有X栏不用填写)

1、Ethernet报文 字段名 起止字节地址 内容(十六进制) 意义 00-0d X X Ethernet报头 Source MAC Dest. MAC Type 06-0b 00-05 0c-0d 源物理地址 目标物理地址 协议为IP 0800 2、IP报文 字段名 IP报头 Protocol 3、TCP报文 字段名 TCP报头 Windows size

起止字节地址 0e-21 17-17 内容(十六进制) X 06 意义 X 协议为TCP 起止字节地址 22-35 30-31 内容(十六进制) X 1920 意义 X 接收窗口6432字节

4、HTTP报文 字段名 Status line Head lines Entity body

起止字节地址 36-46 内容(十六进制) 意义 版本http/1.1 状态吗200 短语ok X X 47-16b 16e-1b6 X X 5、该分组到达目标机后,执行什么操作?产生的效果是什么? Answer:

实验四 Socket编程及应用

一、试验目的

? ?

了解Socket编程方法。 熟悉Socket应用。

二、实验环境

? Windows操作系统 ? Ethereal协议分析仪 ? VC++

三、试验内容

1、分析socket应用程序

2、网上聊天

(1)用Ethereal捕获报文。 (2)用socket软件聊天。

(3)分析聊天内容与TCP/IP协议关系。

3、简单浏览器

(1)用Ethereal捕获报文。

(2)以socket软件作为浏览器,编制请求报文。 (3)请求报文发往:192.168.1.20 (4)分析响应报文。

三、实验报告要求 1、网上聊天

? 聊天内容 Hi,guo! Hi,du!

? 源IP地址、目标IP地址是什么? 原:192.168.0.139 ,目:192.168.0.140 ? 传输层协议、端口号是什么? TCP,2000

? 应用层协议是什么? Answer:无

?

应用层报文是什么? Answer:无

2、简单浏览器

?

输入的请求报文什么? Answer: GET /hll.html HTTP/1.1

Host: 192.168.0.250

? 收到的响应报文什么? Answer:

Hello Everyone !

? 应用层协议是什么? Answer:HTTP

本文来源:https://www.bwwdw.com/article/0tc3.html

Top