ping, traceroute, tracepath, host, wget, ifconfig - oregon...
TRANSCRIPT
ping, traceroute, tracepath, host, wget, ifconfig
‣ ping sends a tiny request to an IP address and waits for a response – default packet is 56 bytes
‣ ping is a quick and easy way to test connectivity
e.g., UNIX> ping www.google.com
UNIX> ping www.google.com
PING www.l.google.com (74.125.225.52) 56(84) bytes of data.
64 bytes from 74.125.225.52: icmp_seq=1 ttl=55 time=44.2 ms
64 bytes from 74.125.225.52: icmp_seq=2 ttl=55 time=24.8 ms
<CTRL-C>
--- www.l.google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 24.897/34.570/44.243/9.673 ms
64 bytes from 74.125.225.52: icmp_seq=1 ttl=55 time=44.2 ms
…
2 packets transmitted, 2 received, 0% packet loss, time 999ms
…
rtt min/avg/max/mdev = 24.897/34.570/44.243/9.673 ms
ping’s Tx a,empt #
Time To Live round trip 7me
round trip 7me minimum/average/maximum/devia7on
‣ ping will notify you if the host does not exist
UNIX> ping www.7u3483.com
ping: unknown host www.7u3483.com
‣ -c option tells ping to stop after sending N packets
UNIX> ping -c 1 www.google.com
PING www.l.google.com (74.125.225.84) 56(84) bytes of data.
64 bytes from 74.125.225.84: icmp_seq=1 ttl=55 time=26.1 ms
--- www.l.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 26.172/26.172/26.172/0.000 ms
‣ -i option to select the interval between packets
‣ default is 2.0 seconds
UNIX> ping –i 0.5 www.google.com
…
‣ -s to select packet size in bytes ‣ default is 56 bytes
UNIX> ping -s 20000 www.google.com …
‣ Are more packets lost?
‣ traceroute prints the route packets trace to network host
‣ At each hop, traceroute sends probe packets, prints the round trip time of each
UNIX> traceroute www.google.com
traceroute to www.google.com (74.125.225.80), 30 hops max, 40 byte packets
…
‣ -q option to set number of probe packets per hop
‣ default is 3
UNIX> traceroute –q 10 www.google.com
traceroute to www.google.com (74.125.225.80), 30 hops max, 40 byte packets
…
‣ tracepath traces path to a network host discovering MTU along this path ‣ MTU – Maximum Transmission Unit
– size, in bytes, of the largest protocol data unit that a communication layer can pass through
– Path MTU (pmtu): Networking metric to find path that avoids packet fragmentation
UNIX> tracepath www.google.com …
‣ host command to look up DNS information – DNS : Domain Name System – converts hostnames to ip
addresses
UNIX> host www.google.com
www.google.com is an alias for www.l.google.com.
www.l.google.com has address 74.125.225.80
…
‣ Using host, we discover that Google has an IP address of 74.125.225.80
‣ If we plug 74.125.225.80 into a browser…
‣ wget downloads files from the Internet
‣ Download pretty much anything…
UNIX> wget http://inside.mines.edu/~qhan/images/mines-logo.jpg
Resolving www.mines.edu... 138.67.1.8
Connecting to www.mines.edu|138.67.1.8|:80... connected.
…
2012-08-06 16:31:56 (409 MB/s) - `mines-logo.jpg' saved [30905/30905]
‣ -O (dash o) option renames the downloaded file
UNIX> wget http://www.mines.edu/~qhan/images/mines-logo.jpg –O csm-logo.jpg
…
‣ -i option to specify an input file of URLs to download
UNIX> cat > URLs.txt http://eecs.mines.edu/Courses/csci274/Content/compilation.html
http://eecs.mines.edu/Courses/csci274/Content/editors.html
http://eecs.mines.edu/Courses/csci274/Content/execution.html
<CTRL-C>
UNIX> wget –i URLs.txt
…
‣ ifconfig queries and controls the networking interface
‣ ifconfig can reveal lots of information about your networking interface – MAC address
– IP, netmask, broadcast address
– MTU
– etc.
UNIX> ifconfig
‣ http://eecs.mines.edu/Courses/csci274/Assignments/14_network.html