不是我自己写的,在学Python,所以对源码很感兴趣. 贴出来给同样有兴趣的朋友看看. #!/usr/bin/env python # -*- coding: iso-8859-1 -*- """ping.py ping.py uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. Copyright (C) 2004 - Lars Strand ; This program is free software; you can redistribute it and/or modify it under the terms of the...
by neilton - Python文档中心 - 2006-05-07 09:18:09 阅读(944) 回复(0)
#!/usr/bin/env python """ping.py ping.py uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. Copyright (C) 2004 - Lars Strand ; This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at you...
转自:CSNA网络分析论坛 关键字:ping 最大值 网络 分析 科来 上午有朋友在问,“在pc上ping pc,数据包大小为8000可以通,为什么啊?” 为什么会有这样的疑问呢,原因很简单,以太网II的数据包不是在64~1518字节之内吗?怎么带8000的参数,都还可以ping通呢? 仔细一想,ICMP协议工作在网络层,而以太网II是工作在以太网层,所以ICMP协议与64~1518的限制,应该没有必然的联系。为验证推论是否正确,做了以下的实验。 1.在Wind...
对于ping,发送的是一个echo request包,类型为 8 0,当被ping者接到相关icmp包的时候,根据实际情况,逻辑是,就发回 reply 0 0,逻辑否,则根据具体情况发出一些其他的信息,总结起来的说,是看目的是否能及时的把icmp reply包送回到源,一当路径上的某个节点把reply包给deny掉了,就肯定ping不通了,比如会是time out, 下面是对ping的一些debug 输出,debug ip pa de 100,access-list 100 permit icmp any any, 1、这个是ping...
ping程序严格的说是基于TCP/IP协议中的三层与四层之间,利用应用定时器来计算ICMP分组的RTT(往返时间)。程序发送一个ICMP回显请求分组给服务器,服务器紧接着向客户回复一个回显应答分组。客户可以在回显请求分组中将发送时的时钟值作为用户可选数据记录在该分组中,然后服务器会在应答中返回这个时钟值。客户收到回显应答时,它就取当前时钟值计算出RTT,然后打印出来。以下是ping分组的格式 ping程序允许我们指定分...
注意TTL TTL:生存时间 指定数据报被路由器丢弃之前允许通过的网段数量。 TTL 是由发送主机设置的,以防止数据包不断在 IP 互联网络上永不终止地循环。转发 IP 数据包时,要求路由器至少将 TTL 减小 1。 使用ping时涉及到的 ICMP 报文类型 一个为ICMP请求回显(ICMP Echo Request) 一个为ICMP回显应答(ICMP Echo Reply) 、TTL 字段值可以帮助我们识别操作系统类型。 UNIX 及类 UNIX 操作系统 ICMP 回显应答的 T...
我有两台solaris10的机器,我怀疑一台的网卡有问题或连向的交换机有问题,所以我在两台机器上ping同一台机器,结果是这样的: 第一台,返回时间都比较均衡 64 bytes from 172.23.212.104: icmp_seq=244. time=0.725 ms 64 bytes from 172.23.212.104: icmp_seq=245. time=0.735 ms 64 bytes from 172.23.212.104: icmp_seq=246. time=0.704 ms 64 bytes from 172.23.212.104: icmp_seq=247. time=0.676 ms 64 bytes from 172.23.21...
【教学视频系列-3】扩展ping命令分析、实战 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14412/showart_79313.html