0% found this document useful (0 votes)
17 views8 pages

EX NO 1

The document outlines various networking commands such as tcpdump, netstat, ifconfig, nslookup, and traceroute, along with their functions and usage. It also includes Java code examples for a simple ping client and server, demonstrating basic network programming concepts. The aim is to learn and utilize these commands and analyze network protocol data units (PDUs).

Uploaded by

mimictroll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views8 pages

EX NO 1

The document outlines various networking commands such as tcpdump, netstat, ifconfig, nslookup, and traceroute, along with their functions and usage. It also includes Java code examples for a simple ping client and server, demonstrating basic network programming concepts. The aim is to learn and utilize these commands and analyze network protocol data units (PDUs).

Uploaded by

mimictroll
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Learn to use commands like tcpdump, netstat, ifconfig, nslookup

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 /all: This command displays detailed configuration information about


your TCP/IP connection including Router, Gateway, DNS, DHCP, and type of
Ethernet adapter in your system.

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.

C:\>netstat: Netstat displays a variety of statistics about a computers active TCP/IP


connections. This tool is most useful when you’re having trouble with TCP/IP

721222104048
applications such as HTTP, and FTP.

C:\>nslookup: Nslookup is used for diagnosing DNS problems. If you can


access a resource by specifying an IP address but not it’s DNS you have a DNS
problem.

C:\>pathping: Pathping is unique to Window’s, and is basically a combination of the Ping


and Tracert commands. Pathping traces the route to the destination address then launches a
25 second test of each router along the way, gathering statistics on the rate of data loss along
each hop.

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

public static void main(String args[])throws Exception

String

721222104048
str; int
c=0; long
t1,t2;

Socket s=new Socket("127.0.0.1",5555);


DataInputStream dis=new
DataInputStream(s.getInputStream());

PrintStream out=new PrintStream(s.getOutputStream());


while(c<4)

t1=System.currentTimeMillis();

str="Welcome to network programming


world"; out.println(str);
System.out.println(dis.readLine());
t2=System.currentTimeMillis();
System.out.println(";TTL="+(t2-t1)+"ms");
c++;

s.close();
}}

//pingserver.java
import java.io.*;
import java.net.*;
import java.util.*;
import java.text.*;
class pingserver

public static void main(String args[])throws Exception

ServerSocket ss=new ServerSocket(5555);


Socket s=ss.accept();

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

Thus the above list of primitive has been studied.

721222104048

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy