EX NO 1
EX NO 1
EXNO: 1 and traceroute. Capture ping and trace route PDUs using a network
protocol analyzer and examine.
AIM
To learn and use networking commands like tcpdump, netstat, ifconfig, nslookup
and traceroute and to capture ping and trace route PDUs using a network protocol analyzer and
examine.
COMMANDS
C:\>arp –a: ARP is short form of address resolution protocol, It will show the IP address of
your computer along with the IP address and MAC address of your router.
C:\>hostname: This is the simplest of all TCP/IP commands. It simply displays the name of
your computer.
C:\>ipconfig: The ipconfig command displays information about the host (the
computer your sitting at)computer TCP/IP configuration.
C:\>Ipconfig /renew: Using this command will renew all your IP addresses that you are
currently (leasing) borrowing from the DHCP server. This command is a quick problem
solver if you are having connection issues, but does not work if you have been configured
with a static IP address.
C:\>Ipconifg /release: This command allows you to drop the IP lease from the
DHCP server.
C:\>ipconfig /flushdns: This command is only needed if you’re having trouble with your
networks DNS configuration. The best time to use this command is after network
configuration frustration sets in, and you really need the computer to reply with flushed.
C:\>nbtstat –a: This command helps solve problems with NetBIOS name
resolution. (Nbt stands for NetBIOS over TCP/IP)
C:\>netdiag: Netdiag is a network testing utility that performs a variety of network diagnostic
tests, allowing you to pinpoint problems in your network. Netdiag isn’t installed by default,
but can be installed from the Windows XP CD after saying no to the install. Navigate to the
CD ROM drive letter and open the support\tools folder on the XP
CD and click the setup.exe icon in the support\tools folder.
721222104048
applications such as HTTP, and FTP.
C:\>ping: Ping is the most basic TCP/IP command, and it’s the same as placing a phone call
to your best friend. You pick up your telephone and dial a number, expecting your best friend
to reply with “Hello” on the other end. Computers make phone calls to each other over a
network by using a Ping command. The Ping commands main purpose is to place a phone
call to another computer on the network, and request an answer. Ping has 2 options it can
use to place a phone call to another computer on the network. It can use the computers name
or IP address.
C:\>route: The route command displays the computers routing table. A typical
computer, with a single network interface, connected to a LAN, with a router is
fairly simple and generally doesn’t pose any network problems. But if you’re
having trouble
accessing other computers on your network, you can use the route command to make sure
the entries in the routing table are correct.
C:\>tracert: The tracert command displays a list of all the routers that a packet has to go
through to get from the computer where tracert is run to any other computer on the
internet.
Program
//pingclient.java
import java.io.*;
import
java.net.*;
import
java.util.Calendar;
class pingclient
String
721222104048
str; int
c=0; long
t1,t2;
t1=System.currentTimeMillis();
s.close();
}}
//pingserver.java
import java.io.*;
import java.net.*;
import java.util.*;
import java.text.*;
class pingserver
int c=0;
while(c<4)
721222104048
{
DataInputStream dis=new DataInputStream(s.getInputStream());
PrintStream out=new PrintStream(s.getOutputStream());
String str=dis.readLine();
System.out.println("Reply
from"+InetAddress.getLocalHost()+";Length"+str.length());
c++;}
s.close();
}}
OUTPUT
721222104048
721222104048
721222104048
721222104048
RESULT
721222104048