Second job: Packet Tracer analysis using an application layer protocol (DNS, FTP, DHCP, SMTP, POP3)

0 Personal Information

  • Zhang Ying Zi
  • 201821121038
  • Calculated 1812

1 Purpose

Familiar with Packet Tracer tool. Analysis caught application layer protocol packets, application layer protocol-depth understanding, including syntax, semantics, timing.

2 Experimental content

Use Packet Tracer, properly configured network parameter, packet data capture and analysis application layer protocol, the protocol comprising DNS, FTP, DHCP, stmp, pop3. Steps include:

  • Establish a network topology
  • Configuration parameters
  • Ethereal
  • Analysis of the data packet

3 test report

In this study, the use of this platform to Cisco Packet Tracer network simulation environment.

3.1 to establish a network topology

 

 As shown, a PC connected to the terminal end and a Server.

Analysis: The client (PC end ) and server (Sever end ) are two application processes involved in the communication, to achieve the capture of purpose, it is necessary to establish communication relationships that need the same network segment.

3.2 IP Configuration

IP address of the PC side: 192.168.1.38, Subnet Mask: 255.255.255.0

IP address of the server: 192.168.1.1, Subnet Mask: 255.255.255.0

Analysis: for the IP configuration of the PC and the server, which is the same as the subnet mask, the same network segment, may communicate with each other.

3.3 arrested DNS packet and analysis

3.3.1  the server's DNS service is turned on, and the addition of a DNS record:

3.3.2  right corner Simulation key simulation.

3.3.3  just check the DNS protocol support:

 

 

 3.3.4 enter the domain name to access the PC's browser:

 

 

 (Note: When a DNS error occurs, it will display the following page:

The solution is the PC side of the DNS server you want to set the DNS server IP address:

 3.3.5  information transmission result of the simulation are as follows:

 

 

 

3.3.6  packet analysis :

( 1 ) header:

 

  • QDCOUNT ( Questions the Count ) indicates the number of records in the message request issue section
  • Ancount ( Answer the Count ) representation section packets answer to answer the number of records
  • Nscount ( Authoritative Nameservers the Count ) indicates the number of records in the authorization message authorizing segment
  • Arcount are ( Additional Recoreds the Count ) indicates the number of additional recording in the additional segment packets

( 2 ) query messages:

 

  • NAME indicates that the query name, usually need to query the domain name (if reverse lookup is, for the IP address)
  • TYPE represents the type of query, 4 denotes a mail forwarder.
  • CLASS indicates that the query class, 1 is an Internet data
  • TTLTime to Live表示生存时间,以秒为单位,表示的是资源记录的生命周期,一般用于当地址解析程序取出资源记录后决定保存及使用缓存数据的时间,它同时也可以表明该资源记录的稳定程度,极为稳定的信息会被分配一个很大的值(比如86400,这是一天的秒数)。
  • LENGTH表示资源数据长度

3)应答报文:

 

类似于查询报文:

  • NAME表示资源记录包含的域名
  • TYPE表示资源记录的类型
  • CLASS表示资源记录的类
  • TTL表示资源记录的生存周期
  • LENGTH表示资源数据长度
  • IP表示域名解析的结果

3.4 FTP包并分析

3.4.1 将服务器端的FTP服务开启,并增设一条用户记录:

3.4.2 点击右下角的Simulation键进行仿真。

3.4.3 只勾选支持FTP协议:(File Transfer Protocol,文件传输协议)

 

3.4.4 在PC端的Command Prompt(命令提示符,类似于cmd)输入用户名及密码对FTP服务器的文件访问:

 

输入?查询可使用命令:

 

其中,cd可改变远程工作目录,delete可删除远程单个文件,dir可显示远程目录文件的文件列表,get可复制单个远程文件到本地,help与?相同,可显示FTP命令帮助信息,passive可开/关被动模式,put可复制一个本地文件到远程目录,pwd可显示远程当前工作目录,quit可结束FTP会话并退出FTP,rename可重命名远程文件。

(注:FTP有两种使用模式:被动和主动,主动模式要求客户端和服务器端同时打开并监听一个端口以建立连接。但这种情况下,由于客户端安装了防火墙会产生一些问题,所以有了被动模式,被动模式只要求服务器端产生一个监听相应端口的进程,这样就能绕过客户的防火墙了。)

 3.4.5 仿真后的信息传递结果如下:

 

 

3.4.6 报文分析:

1)响应报文:

 

  • Code:220表示新用户服务就绪
  • Message表示对Code的解释

2)响应报文:

 

  • Code:331表示用户名正确,需要密码
  • Message表示对Code的解释

3)请求报文:

 

  • FTP CommandPASS表示密码正确
  • FTP Argument表示密码内容

4)响应报文:

 

  • Code230表示用户已登录
  • Message表示对Code的解释

5)请求报文:

 

  • FTP CommandQUIT表示用户已登出

6)响应报文:

 

  • Code221表示服务京城已关闭连接
  • Message表示对Code的解释

3.5 DHCP包并分析

3.5.1 将服务器端的DHCP服务开启,并设置IP地址分配的开始值192.168.1.0:

接着将PC端的IP获取方式从静态改成DHCP获取(192.168.1.2):

 

3.5.2 点击右下角的Simulation键进行仿真。

3.5.3 只勾选支持DHCP协议:(Dynamic Host Configuration Protocol,动态主机设置协议)

 

 3.5.4 仿真后的信息传递结果如下:

 

 

 

 

3.5.5 报文分析:

1)请求报文:

 

  • OP表示报文类型,1表示请求报文
  • HW TYPE表示硬件地址类型,1表示10Mb/s的以太网的硬件地址
  • HW LEN表示硬件地址长度,以太网中为6
  • HOPS表示跳数,客户端设置为0
  • TRANSACTION ID表示事务ID,由客户端选择的一个随机数,被服务器和客户端用来在它们之间交流请求和响应,客户端用它对请求和应答进行匹配
  • SECS由客户端填充,表示从客户端开始获得IP地址或IP地址续借后所使用了的秒数
  • FLAGS表示标志字段,目前只有最左边的一个比特有用,该位为0,表示单播,为1表示广播
  • CLIENT ADDRESS表示客户端地址,只有客户端是Bound、Renew、Rebinding状态,并且能响应ARP请求时,才能被填充。
  • YOUR CLIENT ADDRESS表示客户端地址
  • SERVER ADDRESS表示DHCP协议流程的下一个阶段要使用的服务器的IP地址
  • RELAY AGENT AGGRESS表示DHCP中继器的IP地址
  • CLIENT HARDWARE ADDRESS表示客户端硬件地址,客户端必须设置它的物理地址
  • SERVER HOSTNAME表示可选的服务器主机名,该字段是空结尾的字符串,由服务器填写
  • FILE表示启动文件名,是一个空结尾的字符串
  • OPTIONS表示可选的参数域,格式为"代码+长度+数据"

2)响应报文:

 

  • OP表示报文类型,2表示响应报文
  • YOUR CLIENT ADDRESS表示客户端地址,此时被分配为192.168.1.2
  • SERVER ADDRESS表示DHCP协议流程的下一个阶段要使用的服务器的IP地址,为192.168.1.1

3DHCP Options

 

  • OP:6表示DNS Server
  • LEN:4表示4个字节
  • DOMAIN NAME SERVER表示域名服务器的IP

 

  • OP:15表示主DNS服务器名
  • LEN:0x0表示长度可变
  • DOMAIN NAME表示域名

3.6 SMTP包并分析(涉及STMP协议和POP3协议)

3.6.1 先将PC端的IP获取由DHCP变为静态获取,并设置其IP地址为192.168.1.38,再对Email中的Configure Mail进行设置:

 

接着将服务器端的IP获取方式从DHCP改成静态获取,并设置其IP地址为192.168.1.1,打开SMTP服务和POP3服务,增加两个用户,接着对Email中的Configure Mail进行设置:

 

 

 

 

3.6.2 点击右下角的Simulation键进行仿真。

3.6.3 只勾选支持SMTP协议和POP3协议:(Simple Mail Transfer Protocol,简单邮件传输协议;Post Office Protocol - Version 3,邮局协议版本3)

3.6.4 PC端写mail给服务器端:

 

另外,只能用PC端接受mail,因为设置的pop3服务器也是服务器端。

(注:如果出现如下问题,说明是DNS服务器未配置好,因为发邮件时是To一个域名,而非IP地址,因此需要域名解析,所以开启服务器端的DNS服务,并增设两条记录:

 

 

 

 

 3.6.5 仿真后的信息传递结果如下:

 

 

 

 

 

 

 

 

 

 

3.6.6 报文分析:

 

  • SMTP DATA表示将邮件报文发送给服务器

 

  • POP3表示接收邮件报文

3.7 Q&A

Q:常用端口号?

A

  • 21/tcp FTP 文件传输协议
  • 22/tcp SSH 安全登录、文件传送(SCP)和端口重定向
  • 23/tcp Telnet 不安全的文本传送
  • 25/tcp SMTP Simple Mail Transfer Protocol (E-mail)
  • 69/udp TFTP Trivial File Transfer Protocol
  • 80/tcp HTTP 超文本传送协议 (WWW)
  • 110/tcp POP3 Post Office Protocol (E-mail)
  • 220/tcp IMAP3
  • 443/tcp HTTPS 安全的网页传输

4 Reference

  · 深入理解DNS报文格式----夜苍山的CSDN博客

https://blog.csdn.net/liao152/article/details/45252387

  · DNS协议详解及报文格式分析----Jocent Zhou的博客

https://jocent.me/2017/06/18/dns-protocol-principle.html

  · FTP命令详解----罗汉爷的CSDN博客

https://blog.csdn.net/indexman/article/details/46387561

  · DHCP报文及其格式----一路博客的CSDN博客

https://blog.csdn.net/one_in_one/article/details/51684551

 

Guess you like

Origin www.cnblogs.com/MilkoSilver/p/11562977.html