Sei sulla pagina 1di 4

Computer Networks and Distributed Systems

Worksheet 4 (Netstat and IPConfig)

Name:

Class:

Please complete this worksheet and print it out.

Background
The netstat (netstat) program can be used to determine TCP/IP protocol statistics and the current TCP/IP network connections. Its format is:
NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval] -a -e -n -p proto -r -s Interval Displays all connections and listening ports. Displays Ethernet statistics. Displays addresses and port numbers in numerical form. Shows connections for the protocol specified by proto; proto may be TCP or UDP. If used with the -s option to display per-protocol statistics, proto may be TCP, UDP, or IP. Displays the routing table. Displays per-protocol statistics. By default, statistics are shown for TCP, UDP and IP; the -p option may be used to specify a subset of the default. Redisplays selected statistics, pausing interval second between each display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will print the current configuration information once.

Examples of its usage are:


C:\WINDOWS>netstat -a Active Connections Proto TCP TCP Local Address bill-s:1060 bill-s:1061

Address of computer: local port number

Destination name: destination port number

Foreign Address csunt1.napier.ac.uk:80 csunt1.napier.ac.uk:80

State CLOSE_WAIT CLOSE_WAIT

Page 1

2001 W.Buchanan/Napier University

Computer Networks and Distributed Systems


TCP TCP TCP TCP bill-s:1062 bill-s:1063 bill-s:1097 bill-s:1106 csunt1.napier.ac.uk:80 CLOSE_WAIT csunt1.napier.ac.uk:80 CLOSE_WAIT artemis.dcs.napier.ac.uk:ftp ESTABLISHED www.eece.napier.ac.uk:telnet CLOSE_WAIT

C:\WINDOWS>netstat -s Active Connections Proto TCP TCP TCP TCP TCP TCP Local Address 62.136.29.56:1060 62.136.29.56:1061 62.136.29.56:1062 62.136.29.56:1063 62.136.29.56:1097 62.136.29.56:1106 Foreign Address 146.176.1.24:80 146.176.1.24:80 146.176.1.24:80 146.176.1.24:80 146.176.161.5:21 146.176.151.139:23 State CLOSE_WAIT CLOSE_WAIT CLOSE_WAIT CLOSE_WAIT ESTABLISHED CLOSE_WAIT

The Ipconfig program can be used to determine the IP configuration. For example, to determine the IP address of the host computer:
C:\WINDOWS>ipconfig Windows 98 IP Configuration

IP address

0 Ethernet adapter :

Subnet mask Gateway address

IP Address. . . . . . . . . : 62.136.29.56 Subnet Mask . . . . . . . . : 255.0.0.0 Default Gateway . . . . . . : 62.136.29.56 C:\WINDOWS>ipconfig /all Windows 98 IP Configuration

Host name

Host Name . . . . . . . . . : BILL'S DNS Servers . . . . . . . . : 195.92.193.8 194.152.64.35 Node Type . . . . . . . . . : Broadcast NetBIOS Scope ID. . . . . . : IP Routing Enabled. . . . . : No WINS Proxy Enabled. . . . . : No NetBIOS Resolution Uses DNS : No 0 Ethernet adapter : Description . . . . . Physical Address. . . DHCP Enabled. . . . . IP Address. . . . . . Subnet Mask . . . . . Default Gateway . . . DHCP Server . . . . . Primary WINS Server . Secondary WINS Server Lease Obtained. . . . Lease Expires . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . : : : : : : : : : : : PPP Adapter. 44-45-53-54-00-00 Yes 62.136.29.56 255.0.0.0 62.136.29.56 255.255.255.255 01 01 80 00:00:00 01 01 80 00:00:00

DNS server

Ethernet address

Page 2

2001 W.Buchanan/Napier University

Computer Networks and Distributed Systems

Practical
Using the IPconfig command determine the following. 4.1 Determine the following settings for your local computer and another computer (the first column contains a sample session):
Example connection (to Freeserve) IP address Host name Subnet mask Gateway DNS server(s) Ethernet physical address Full domain name of computer DHCP server IP address (if used). Note that will only be used if the computer does not have a static IP address. 62.136.29.56 BILL'S 255.0.0.0 62.136.29.56 195.92.193.8 194.152.64.35 44-45-53-54-00-00 Bill-s.freeserve.co.uk Local computer Another computer (please ask someone for their settings)

255.255.255.255

4.2

Start two different WWW sessions (with different sites), then run netstat. From this determine the local port that is used for the connection, and complete the table given next (and example is given in the first row).
Local hostname
bill-s

Connection type (TCP/UDP)


TCP

Local port value


1060

Destination hostname
csunt1.napier.ac.uk

Destination port value


80

State
CLOSE_WAIT

Page 3

2001 W.Buchanan/Napier University

Computer Networks and Distributed Systems 4.3 Go to My Computer, and identify the names of the following network drives:
Network drive Name

F: G: H: J: K:

Page 4

2001 W.Buchanan/Napier University

Potrebbero piacerti anche