Sie sind auf Seite 1von 4

Computer Networks and Distributed Systems

Computer Networks and Distributed Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet

Worksheet 4 (Netstat and IPConfig)

and Distributed Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet and print
and Distributed Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet and print

Name:

Distributed Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet and print it
Distributed Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet and print it
Distributed Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet and print it

Class:

Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet and print it out.
Systems Worksheet 4 (Netstat and IPConfig) Name: Class: Please complete this worksheet and print it out.

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

Displays all connections and listening ports.

-e

Displays Ethernet statistics.

-n

Displays addresses and port numbers in numerical form.

-p proto 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. Interval 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.

-s

-r

Destination name:

destination port number

Examples of its usage are:

C:\WINDOWS>netstat -a

Address of computer:

local port number

State
State
-a Address of computer: local port number State Active Connections Proto Local Address TCP bill-s:1060

Active Connections

Proto Local Address

TCP

bill-s:1060

TCP

bill-s:1061

Foreign Address

csunt1.napier.ac.uk:80 CLOSE_WAIT csunt1.napier.ac.uk:80 CLOSE_WAIT

Computer Networks and Distributed Systems

TCP bill-s:1062

bill-s:1063

TCP bill-s:1097 TCP bill-s:1106

TCP

C:\WINDOWS>netstat -s Active Connections

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

Proto Local Address

Foreign Address

State

TCP

62.136.29.56:1060

146.176.1.24:80

CLOSE_WAIT

TCP

62.136.29.56:1061

146.176.1.24:80

CLOSE_WAIT

TCP

62.136.29.56:1062

146.176.1.24:80

CLOSE_WAIT

TCP

62.136.29.56:1063

146.176.1.24:80

CLOSE_WAIT

TCP

62.136.29.56:1097

146.176.161.5:21

ESTABLISHED

TCP

62.136.29.56:1106

146.176.151.139:23

CLOSE_WAIT

The Ipconfig program can be used to determine the IP configuration. For example, to de- termine the IP address of the host computer:

C:\WINDOWS>ipconfig Windows 98 IP Configuration

IP address

Windows 98 IP Configuration IP address 0 Ethernet adapter : IP Subnet Mask Default Gateway Subnet

0 Ethernet adapter :

IP Subnet Mask Default Gateway

Subnet mask

: 62.136.29.56 : 255.0.0.0 : 62.136.29.56

Gateway address

: 62.136.29.56 : 255.0.0.0 : 62.136.29.56 Gateway address C:\WINDOWS>ipconfig /all Windows 98 IP Configuration

C:\WINDOWS>ipconfig /all

Windows 98 IP Configuration

Host

Name

.

.

.

.

.

.

DNS Servers

 

Node

Type

.

.

.

.

.

Host name

  Node Type . . . . . Host name : BILL'S : 195.92.193.8 DNS server

: BILL'S

: 195.92.193.8

DNS server

. . . Host name : BILL'S : 195.92.193.8 DNS server 194.152.64.35 : Broadcast NetBIOS Scope

194.152.64.35

: Broadcast

NetBIOS Scope

IP Routing

WINS Proxy

NetBIOS Resolution Uses DNS : No

No

No

:

:

:

0 Ethernet adapter :

Description

 

: PPP Adapter.

:

Physical

: 44-45-53-54-00-00

DHCP

Enabled.

.

.

.

.

.

.

. : Yes

IP Subnet Mask Default Gateway DHCP Server Primary WINS Server Secondary WINS Server

 

: 62.136.29.56 : 255.0.0.0 : 62.136.29.56 : 255.255.255.255 :

Lease Lease Expires

: 01 01 80 00:00:00 : 01 01 80 00:00:00

Ethernet address

Lease Expires : 01 01 80 00:00:00 : 01 01 80 00:00:00 Ethernet address Page 2

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)

Local

Another computer (please ask someone for their settings)

computer

IP address

62.136.29.56

   

Host name

BILL'S

   

Subnet mask

255.0.0.0

   

Gateway

62.136.29.56

   

DNS server(s)

195.92.193.8

   

194.152.64.35

Ethernet physical address

44-45-53-54-00-00

   

Full domain name of computer

Bill-s.freeserve.co.uk

   

DHCP server IP address (if used). Note that will only be used if the computer does not have a static IP address.

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 com- plete the table given next (and example is given in the first row).

Connection type

Local

Local

port

Destination

Destination

State

(TCP/UDP)

hostname

value

hostname

port value

TCP

bill-s

1060

csunt1.napier.ac.uk

80

CLOSE_WAIT

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: