Round trip time (RTT) software

Python Methods and Functions

Reception time -Transmission (RTT) — this is the time it takes to send a signal, plus the time it takes to acknowledge receipt of that signal. Therefore, this time consists of the propagation times between two points of the signal. 
On the Internet, an end user can determine the RTT to and from an IP (Internet Protocol) address by pinging that address. The result depends on various factors:

  • The transmission speed of the source of the Internet connection.
  • The nature of the transmission medium.
  • The physical distance between the source and destination.
  • The number of nodes between the source and the destination.
  • The amount of traffic on the local network (LAN) that the end user is connected to.
  • The number of other requests processed intermediate nodes and remote server.
  • The speed at which the intermediate node and remote server are operating.
  • Interference in the chain.

Examples:

 Input: www.python.engineering Output: Time in seconds: 0.212174892426 Input: www.cricbuzz.com Output: Time in seconds: 0.55425786972 

# Python RTT program

 

import time

import requests

 
# Function for calculating RTT

def RTT (url):

 

# signal sending time

t1 = time.time ()

 

r = requests.get (url)

 

  # signal confirmation time

  # received

  t2 = time.time ()

 

# total time

  tim = str (t2 - t1)

  

  print ( "Time in seconds:" + tim)

 
# driver program
# url

url = " http://www.google.com "

RTT (url)

Output:

 Time in seconds: 0.0579478740692 

This article is provided by Pramod Kumar . If you are as Python.Engineering and would like to contribute, you can also write an article using contribute.python.engineering or by posting the article [email protected] ... See my article appearing on the Python.Engineering homepage and help other geeks.

Please post comments if you find anything wrong or if you would like to share more information on the topic discussed above.





Tutorials