19
ping, traceroute, tracepath, host, wget, ifconfig

ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

  • Upload
    ledieu

  • View
    230

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

ping, traceroute, tracepath, host, wget, ifconfig

Page 2: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ 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

Page 3: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

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

Page 4: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

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  

Page 5: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ ping will notify you if the host does not exist

UNIX> ping www.7u3483.com

ping: unknown host www.7u3483.com

Page 6: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣  -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

Page 7: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ -i option to select the interval between packets

‣ default is 2.0 seconds

UNIX> ping –i 0.5 www.google.com

Page 8: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ -s to select packet size in bytes ‣ default is 56 bytes

UNIX> ping -s 20000 www.google.com …

‣ Are more packets lost?

Page 9: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣  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

Page 10: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ -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

Page 11: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣  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 …

Page 12: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ 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

Page 13: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ 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…

Page 14: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ 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]

Page 15: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ -O (dash o) option renames the downloaded file

UNIX> wget http://www.mines.edu/~qhan/images/mines-logo.jpg –O csm-logo.jpg

Page 16: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣  -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

Page 17: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣  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.

Page 18: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

UNIX> ifconfig

Page 19: ping, traceroute, tracepath, host, wget, ifconfig - Oregon …web.engr.oregonstate.edu/~rubinma/Mines_274/Content/Slides/14... · ‣ping sends a tiny request to an IP address and

‣ http://eecs.mines.edu/Courses/csci274/Assignments/14_network.html