Low-Level Features of the Internet
Author
Stephen Wolfram
Title
Low-Level Features of the Internet
Description
Find out how long it takes to “ping” the google.com server:
Category
Educational Materials
Keywords
URL
http://www.notebookarchive.org/2019-08-98zxab4/
DOI
https://notebookarchive.org/2019-08-98zxab4
Date Added
2019-08-20
Date Last Modified
2019-08-20
File Size
42.98 kilobytes
Supplements
Rights
Redistribution rights reserved



Low-Level Features of the Internet
Low-Level Features of the Internet
Find out how long it takes to “ping” the google.com server:
In[]:=
PingTime["google.com",20]

Out[]=
{,,,,$TimedOut,,,,,,,,,,,,,,,}
47.46
ms
47.004
ms
49.224
ms
101.079
ms
52.009
ms
44.784
ms
51.82
ms
50.411
ms
48.278
ms
47.957
ms
48.558
ms
48.305
ms
60.089
ms
46.923
ms
128.546
ms
51.57
ms
45.933
ms
49.165
ms
49.4
ms
Now try it for the Chinese site baidu.cn:
In[]:=
PingTime["baidu.cn",20]
Out[]=
{,,,,,,,,,,,,,,,,,,,}
305.133
ms
397.75
ms
499.102
ms
300.925
ms
393.285
ms
909.818
ms
396.811
ms
295.822
ms
501.411
ms
398.328
ms
501.161
ms
398.204
ms
397.242
ms
295.912
ms
282.547
ms
410.373
ms
286.826
ms
280.501
ms
932.45
ms
397.429
ms
Make a histogram of ping times:
In[]:=
Histogram[PingTime["baidu.cn",50]]
Out[]=
This gives the distance from here to Beijing, divided by the speed of light:
In[]:=
GeoDistanceHere,
Beijing | CITY |
Out[]=
6706.21
mi/
c
Convert to standard units:
In[]:=
UnitConvert[%]
Out[]=
0.0360003
s
The result is 36 ms (36 milliseconds), which is only 10% of the actual ping time to baidu. (Signals in optical fibers go 50% slower than the speed of light in a vacuum, but the transmission time is not the main effect; it’s mostly time spent in relays and repeaters.)
Look up the IP addresses for baidu.cn:
In[]:=
HostLookup["baidu.cn"]
Out[]=
{IPAddress[39.156.66.10],IPAddress[123.125.114.144],IPAddress[220.181.38.148],IPAddress[220.181.38.251]}
Some sites don’t allow pinging:
In[]:=
PingTime["www.vatican.va"]

Out[]=
$TimedOut
Low-Level Interactions
Low-Level Interactions
Reading from a URL:
In[]:=
URLRead["https://www.google.com"]
Out[]=
HTTPResponse
|
Here’s the first 20 lines of the actual body that’s returned:
In[]:=
Snippet[%["Body"],20]
Out[]=
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage"lang="en"><head><meta content="Search the world's information, includingwebpages, images, videos and more. Google has many special features to help youfind exactly what you're looking for." name="description"><meta content="noodp"name="robots"><meta content="text/html; charset=UTF-8"http-equiv="Content-Type"><metacontent="/images/branding/googleg/1x/googleg_standard_color_128dp.png"itemprop="image"><title>Google</title><scriptnonce="zTdlOCVS3sFFCjg0jPuD2A==">(function(){window.google={kEI:'xJtLXZK5HoyrtQaczI_oDg',kEXPI:'0,1353804,1957,2423,1225,731,223,510,1065,3152,56,322,206,397,674,121,1309,435,268,10,745,1132914,1197712,416,329140,1294,12383,4855,32691,15248,867,12163,6381,3335,2,2,6801,369,3314,5505,224,2212,5373,575,1119,2,1306,2432,58,2,1,3,1297,284,4040,3699,1267,774,2256,1401,4483,9,8159,669,1050,1808,1478,7,1,2,472,16,2044,8909,5297,516,381,1119,38,920,753,120,1217,1364,1611,2736,1558,1503,2,631,3240,44,1766,2382,634,526,2094,620,2884,20,317,1119,904,1150,975,1,368,1317,1461,519,400,992,97,1188,8,109,2513,174,967,48,553,11,15,9,1269,2212,202,323,5,68,1177,7,840,324,193,793,275,398,56,820,2620,335,483,109,151,1187,1,3,122,559,830,552,606,1830,9,2,182,545,50,82,1100,143,377,360,326,1019,242,747,29,31,1,184,184,44,207,1,1,780,35,6,72,328,1284,16,86,133,201,81,507,70,414,768,146,191,330,41,1361,29,208,607,91,10,328,45,509,668,162,500,229,501,60,46,134,317,671,93
Evaluate this to find the cookies being used from your Wolfram Language system:
In[]:=
$Cookies


Cite this as: Stephen Wolfram, "Low-Level Features of the Internet" from the Notebook Archive (2019), https://notebookarchive.org/2019-08-98zxab4

Download

