Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Ex 1, 2 CN LAB 2017 Reulation

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Ex. No.

: 1 BASIC NETWORKING COMMANDS

AIM

To study the basic network commands.

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

It simply displays the name of your computer.

OUTPUT
IPCONFIG COMMAND

The ipconfig command displays information about the host computer TCP/IP
configuration.

IPCONFIG /ALL COMMAND

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

The route command displays the computers routing table.

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

Viva Questions: All commands

RESULT

Thus the network commands are studied and executed.


Ex. No.: 2

HTTP WEB CLIENT PROGRAM TO DOWNLOAD A WEB PAGE USING TCP SOCKETS

Aim:

To write a Java Program to download a webpage using TCP socket.

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 class Main {

public Main() {

public static void main(String[] args)

try

String obj;

URL a=new URL("http://trb.tn.nic.in/");

BufferedReader b=new BufferedReader(new InputStreamReader(a.openStream()));

while((obj=b.readLine())!=null)

{
System.out.println(obj);

System.out.println("Web page Downloaded.. ");

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:

1. What is HTTP and WWW?


2. To which OSI layer does IP and HTTP belong?

3. What is Secure HTTP (https)?

4. What is the current version of HTML?

5. What is HTTP session and session ID?

6. What is the main usage of session ID?

7. Define cookie.

8. List some real time examples where the cookies are used.

9. Define URL. What are its parts?

10. Brief on the use of the following java commands:

i. socket()

ii. getOutputStream()

iii. openStream()

iv. getInputStream()

v. readLine()

vi. new command

Result:

Thus the Java program to download a web page using TCP sockets is written, executed and the
output has been verified.

You might also like