2018年11月

TTCP requires Cisco IOS® Software Version 11.2 or higher and Feature
Sets IP Plus (is- images) or Service Provider (p- images). Note: The
ttcp command is a hidden, unsupported, privileged mode command. As
such, its availability may vary from one Cisco IOS software release to
another, such that it might not exist in some releases. Some
platforms, for instance, require the Cisco IOS Enterprise feature set
in order to perform this activity.

可以路由器对路由器,路由器对电脑

customer-dialin-sj>ttcp 
transmit or receive [receive]: transmit 
Target IP address: 10.1.1.52 
perform tcp half close [n]: 
use tcp driver [n]: 
send buflen [8192]: #buffers长度
send nbuf [2048]: 50 #buffers数量
bufalign [16384]: 
bufoffset [0]: 
port [5001]: 
sinkmode [y]: 
buffering on writes [y]: 
show tcp information at end [n]:
ttcp-t: buflen=8192, nbuf=50, align=16384/0, port=5001 tcp ->10.1.1.52
ttcp-t: connect (mss 1460, sndwnd 4096, rcvwnd 4128) 

Result

ttcp-t: buflen=8192, nbuf=50, align=16384/0, port=5001 tcp -> 10.1.1.52 ttcp-t: connect (mss 1460, sndwnd 4096, rcvwnd 4128) ttcp-t: 409600 bytes in 84544 ms (84.544 real seconds) (~3 kB/s) +++ ttcp-t: 50 I/O calls
ttcp-t: 0 sleeps (0 ms total) (0 ms average) 
Since it is most common to evaluate connect speeds in kbps (kilobits
per second, or 1000 bits per second) rather that KBps (kilobytes per
second, or 1024 bytes per second), we must use the information from
TTCP to calculate the bit rate (in kbps). Use the number of bytes
received and the transfer time to calculate the actual bit rate for
the connection. Calculate the bit rate by converting the number of
bytes into bits and then divide this by the time for the transfer. In
this example, the windows PC received 409600 bytes in 84.94 seconds.
We can calculate the bit rate to be (409600 bytes * 8 bits per byte)
divided by 84.94 seconds=38577 BPS or 38.577 kbps.

Referer: Using Test TCP (TTCP) to Test Throughput

#coding:utf-8
from selenium import webdriver
import time
import os
import sys
from selenium.webdriver.firefox.options import Options
import requests

options = Options()
options.set_headless(headless=True)
driver = webdriver.Firefox(firefox_options=options)
driver.get('https://feng.cmd.gd/')
driver.set_page_load_timeout(30)
hiname = driver.find_element_by_xpath("//div[@id='chart']//p[@class='chart z']//a[@class='xi2']").text
userimg = '/web/wwwroot/default/' + hiname + '.png'
if not os.path.isfile(userimg):
    driver.find_element_by_xpath("//div[@id='chart']//p[@class='chart z']//a[@class='xi2']").click()
    time.sleep(2)
    driver.switch_to_window(driver.window_handles[1])
    driver.save_screenshot(userimg)
    #---upload image
    smms = 'https://sm.ms/api/upload'
    files = {'smfile': open(userimg, 'rb')}
    response = requests.post(smms, files=files)
    imgurl = response.json()
    print imgurl
    wtxt = open('/web/wwwroot/default/upload.txt', 'a')
    wtxt.write(str(imgurl))
    wtxt.close()

driver.quit()   #quit-firefox-drive
sys.exit(0)

ICMP Record Route反向路径追踪最大9跳,使用IP Option 7 More IP Options

r4#trace 150.1.5.5
Type escape sequence to abort.
Tracing the route to 150.1.5.5
  1 155.1.45.5 4 msec
    155.1.0.5 4 msec *
r4#
r4#ping
Protocol [ip]:
Target IP address: 150.1.5.5
Repeat count [5]: 2
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]: record
Number of hops [ 9 ]:
Loose, Strict, Record, Timestamp, Verbose[RV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 2, 100-byte ICMP Echos to 150.1.5.5, timeout is 2 seconds:
Packet has IP options:  Total option bytes= 39, padded length=40
 Record route: <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)

Reply to request 0 (4 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (155.1.45.4) <-s0/1
   (150.1.5.5)  <-destination
   (155.1.45.5) <-return path
   (155.1.45.4) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list

Reply to request 1 (8 ms).  Received packet has options
 Total option bytes= 40, padded length=40
 Record route:
   (155.1.0.4) <-s0/0
   (150.1.5.5) <-destination
   (155.1.0.5) <-return path
   (155.1.0.4) <*>
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
   (0.0.0.0)
 End of list

Success rate is 100 percent (2/2), round-trip min/avg/max = 4/6/8 ms