Ex 1, 2 CN LAB 2017 Reulation
Ex 1, 2 CN LAB 2017 Reulation
Ex 1, 2 CN LAB 2017 Reulation
AIM
COMMANDS
ARP -a COMMAND
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.
OUTPUT
HOSTNAME COMMAND
OUTPUT
IPCONFIG COMMAND
The ipconfig command displays information about the host computer TCP/IP
configuration.
This command displays detailed configuration information about your TCP/IP connection
including Router, Gateway, DNS, DHCP, and type of Ethernet adapter in your system.
NBTSTAT –a COMMAND
nbt stands for NetBIOS over TCP/IP. This command helps solve problems with NetBIOS
name resolution.
NETSTAT COMMAND
Netstat displays a variety of statistics about computers active TCP/IP connections. This tool
is most useful when you’re having trouble with TCP/IP applications such as HTTP, and FTP.
NSLOOKUP COMMAND
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.
PATHPING COMMAND
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.
PING COMMAND
The ping command is used as a simple way to verify that a computer can communicate over
the network with another computer or network device.
ROUTE COMMAND
TRACERT COMMAND
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.
YouTube Links:
https://www.geeksforgeeks.org/network-configuration-trouble-shooting-
commands-linux/
https://www.youtube.com/watch?v=75lCgcXP4dc
https://www.youtube.com/watch?v=Gb5V8aXaFfc
https://www.youtube.com/watch?v=AimCNTzDlVo
RESULT
HTTP WEB CLIENT PROGRAM TO DOWNLOAD A WEB PAGE USING TCP SOCKETS
Aim:
Algorithm:
1. Start.
2. Import necessary header files.
3. Provide the web page to be downloaded in the URL constructor.
4. Establish socket connection between the client and the server and open
a BufferedReader on the socket.
5. Display the HTML Code of the host using readline().
6. Stop.
Main.java
import java.io.*;
import java.net.*;
public Main() {
try
String obj;
while((obj=b.readLine())!=null)
{
System.out.println(obj);
catch(Exception e)
System.out.println(e);
OUTPUT
Web Page:
HTML code:
YouTube Link:
https://www.youtube.com/watch?v=c13XxZgUVj0
https://www.youtube.com/watch?v=vCDrGJWqR8w
Viva Questions:
7. Define cookie.
8. List some real time examples where the cookies are used.
i. socket()
ii. getOutputStream()
iii. openStream()
iv. getInputStream()
v. readLine()
Result:
Thus the Java program to download a web page using TCP sockets is written, executed and the
output has been verified.