CN LAB Manual
CN LAB Manual
GREATATER NOIDA
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
LIST OF EXPERIMENTS
1 To learn handling and configuration of networking hardware like RJ-45 connector, CAT-6
cable, crimping tool, etc.
2 Running and using services/commands like ping, traceroute, nslookup, arp, telnet,ftp,etc.
3 Study of network of IP
7 WAP using TCP sockets (like date and time server, echo server and client etc.)
Mr. Ashwini Verma, Mr. Virendra Pal Singh Dr. Sandeep Saxena
Mr. Javed Khan H.O.D (CSE)
(Subject Teachers)
GREATATER NOIDA INSTITUTE OF TECHNOLOGY
GREATATER NOIDA
LAB MANUAL
PREPARED BY
By this Students have to understand basic networking commands e.g ping, tracert etc. All commands related
to Network configuration which includes how to switch to privilege mode and normal mode and how to
configure router interface and how to save this configuration to flash memory or permanent memory.
This commands includes
ð Configuring the Router commands
ð General Commands to configure network
ð Privileged Mode commands of a router
ð Router Processes & Statistics
ð IP Commands
ð Other IP Commands e.g. show ip route etc.
ð
(A). ipconfig command- The IPConfig command will display basic IP address configuration information for
the device. Simply type IPConfig at the Windows command prompt, and you will be presented with the IP
address, subnet mask, and default gateway that the device is currently using.
(B).Command ipconfig/all- IPConfig/all causes Windows to display IP address configuration that is much
more verbose. This is also the command that you will have to use if you want to see which DNS server the
Windows device is configured to use.
(C).Command nslookup- NSLookup is a great utility for diagnosing DNS name resolution problems. Just
type the NSLookup command, and Windows will display the name and IP address of the device’s default
DNS server. From there, you can type host names in an effort to see if the DNS server is able to resolve the
specified host name.
(D).Command ping - Ping is used to test the ability of one network host to communicate with another.
Simply enter the Ping command, followed by the name or the IP address of the destination host. Assuming
that there are no network problems or firewalls preventing the ping from completing, the remote host will
respond to the ping with four packets. Receiving these packets rms that a valid and functional network path
exists between the two hosts.
(E).Command tracert- Tracert, or “Trace Route,” is a utility for examining the path to a remote host.
Functionally, Tracert works similarly to Ping. The major difference is that Tracert sends a series of ICMP
echo requests, and the request’s TTL increased by 1 each time. This allows the utility to display the routers
through which packets are passing to be identified. When possible, Windows displays the duration and IP
address or fully qualified domain name of each hop.
Experiment-3
Program Objective:
Study of network IP.
Procedure: To do this EXPERIMENT- follows these steps:
• Classification of IP address
As show in figure we teach how the IP addresses are classified and when they are used.
On the host computer, follow these steps to share the Internet connection:
The network adapter that is connected to the LAN is configured with a static IP address of 192.168.0.1
and a subnet mask of 255.255.255.0
Note: You can also assign a unique static IP address in the range of 192.168.0.2 to
192.168.0.254. For example, you can assign the following static IP address, subnet mask, and default
gateway:
8) IP Address 192.168.31.202
9) Subnet mask 255.255.255.0
10) Default gateway 192.168.31.1
11) In the Local Area Connection Properties dialog box, click OK.
12) Quit Control Panel.
Experiment-4
Program Objective: How to analyze the data over the network and keeping track of particular protocols
Program Prerequisites: System installed with Wireshark
Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting, analysis,
software and communications protocol development, and education. Wireshark lets the user put network
interface controllers into promiscuous mode (if supported by the network interface controller), so they can see
all the traffic visible on that interface including unicast traffic not sent to that network interface
controller's MAC address.
Features of Wireshark.
Data can be captured "from the wire" from a live network connection or read from a file of already-captured
packets. Live data can be read from different types of networks, including Ethernet, IEEE 802.11, PPP,
and loopback. Captured network data can be browsed via a GUI, or via the terminal (command line) version
of the utility, TShark.
Captured files can be programmatically edited or converted via command-line switches to the "editcap"
program. Data display can be refined using a display filter. Plug-ins can be created for dissecting new
protocols. VoIP calls in the captured traffic can be detected. If encoded in a compatible encoding, the media
flow can even be played. Raw USB traffic can be captured. Wireless connections can also be filtered as long
as they traverse the monitored Ethernet.
Various settings, timers, and filters can be set to provide the facility of filtering the output of the captured
traffic.
4.1 Apply No filter to see all the packets send and received.
4.2 Apply filter such as TCP/UDP to see packet from that particular protocol.
4.3 Open a website (Ex-youtube.com) and analyze those packets.
6.1 When one system send the data to other system – The data first goes to the hub and then hub broadcast
that data.
6.2 The data goes to all system which are connected to hub except sender but it can get that system for
which that data was sent and rest all will not get that it show cross on that system. The output is shown
in picture
6.3 When the receiver send the ack to the sender-that the data has been received it also go through the hub
6.4 The hub send the acknowledgement to the receiver.
EXPERIMENT- 7
Program Prerequisites: System installed with C and JAVA compiler (512 MB RAM, 32GB HDD)
ALGORITHM: CLIENT
4. the client connection accept to the server and replay to read the system date and time.
ALGORITHM: SERVER
Program Code:
DATECLIENT:
import java.net.*;
import java.io.*;
class dateclient
{
public static void main (String args[])
{
Socket soc;
DataInputStream dis;
String sdate;
PrintStream ps;
try
{
InetAddress ia=InetAddress.getLocalHost();
soc=new Socket(ia,8020);
dis=new DataInputStream(soc.getInputStream());
sdate=dis.readLine();
System.out.println("THE date in the server is:"+sdate);
ps=new PrintStream(soc.getOutputStream());
ps.println(ia);
}
catch(IOException e)
{
System.out.println("THE EXCEPTION is :"+e);
}
}
}
DATESERVER:
import java.net.*;
import java.io.*;
import java.util.*;
class dateserver
{
public static void main(String args[])
{
ServerSocket ss;
Socket s;
PrintStream ps;
DataInputStream dis;
String inet;
try
{
ss=new ServerSocket(8020);
while(true)
{
s=ss.accept();
ps=new PrintStream(s.getOutputStream());
Date d=new Date();
ps.println(d);
dis=new DataInputStream(s.getInputStream());
inet=dis.readLine();
System.out.println("THE CLIENT SYSTEM ADDRESS IS :"+inet);
ps.close();
}
}
catch(IOException e)
{
System.out.println("The exception is :"+e);
}
}
}
OUTPUT:
CLIENTSIDE:
C:\Program Files\Java\jdk1.5.0\bin>javac dateclient.java
Note: dateclient.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
C:\Program Files\Java\jdk1.5.0\bin>java dateclient
THE date in the server is:Sat Jul 19 13:01:16 GMT+05:30 2008
C:\Program Files\Java\jdk1.5.0\bin>
SERVERSIDE:
C:\Program Files\Java\jdk1.5.0\bin>javac dateserver.java
Note: dateserver.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
C:\Program Files\Java\jdk1.5.0\bin>java dateserver
THE CLIENT SYSTEM ADDRESS IS :com17/192.168.21.17
1) CLIENT-SERVER APPLICATION FOR CHAT
Program Objective: To write a client-server application for chat using TCP
ALGORITHM: CLIENT
1. Start the program
5. The client accept the connection and to send the data from client to server and vice versa
6. The client communicate the server to send the end of the message
ALGORITHM: SERVER
5. The server accept the connection and to send the data from server to client and vice versa
6. The server communicate the client to send the end of the message
Program Code:
TCPserver1.java
import java.net.*;
import java.io.*;
public class TCPserver1
{
public static void main(String arg[])
{
ServerSocket s=null;
String line;
DataInputStream is=null,is1=null;
PrintStream os=null;
Socket c=null;
try
{
s=new ServerSocket(9999);
}
catch(IOException e)
{
System.out.println(e);
}
try
{
c=s.accept();
is=new DataInputStream(c.getInputStream());
is1=new DataInputStream(System.in);
os=new PrintStream(c.getOutputStream());
do
{
line=is.readLine();
System.out.println("Client:"+line);
System.out.println("Server:");
line=is1.readLine();
os.println(line);
}while(line.equalsIgnoreCase("quit")==false);
is.close();
os.close();
}
catch(IOException e)
{
System.out.println(e);
}
}
}
TCPclient1.java
import java.net.*;
import java.io.*;
public class TCPclient1
{
public static void main(String arg[])
{
Socket c=null;
String line;
DataInputStream is,is1;
PrintStream os;
try
{
c=new Socket("10.0.200.36",9999);
}
catch(IOException e)
{
System.out.println(e);
}
try
{
os=new PrintStream(c.getOutputStream());
is=new DataInputStream(System.in);
is1=new DataInputStream(c.getInputStream());
do
{
System.out.println("Client:");
line=is.readLine();
os.println(line);
System.out.println("Server:" + is1.readLine());
}while(line.equalsIgnoreCase("quit")==false);
is1.close();
os.close();
}
catch(IOException e)
{
System.out.println("Socket Closed!Message Passing is over");
}
}
OUT PUT :
Server
C:\Program Files\Java\jdk1.5.0\bin>javac TCPserver1.java
Note: TCPserver1.java uses or overrides a deprecated API.
Server:
Hai Client
Server:
Fine
Client: quit
Server:
quit
Client
C:\Program Files\Java\jdk1.5.0\bin>javac TCPclient1.java
Client:
Hai Server
Client:
How are you
Server: Fine
Client:
quit
Server: quit
ALGORITHM:
5. The client accept the connection and send data to server and the server to replay the echo message to the
client
6. The client communicate the server to send the end of the message
Program :
EServer.java
import java.net.*;
import java.io.*;
public class EServer
{
public static void main(String args[])
{
ServerSocket s=null;
String line;
DataInputStream is;
PrintStream ps;
Socket c=null;
try
{
s=new ServerSocket(9000);
}
catch(IOException e)
{
System.out.println(e);
}
try
{
c=s.accept();
is=new DataInputStream(c.getInputStream());
ps=new PrintStream(c.getOutputStream());
while(true)
{
line=is.readLine();
ps.println(line);
}
}
catch(IOException e)
{
System.out.println(e);
}
}
}
EClient.java
import java.net.*;
import java.io.*;
public class EClient
{
public static void main(String arg[])
{
Socket c=null;
String line;
DataInputStream is,is1;
PrintStream os;
try
{
c=new Socket("10.0.200.43",9000);
}
catch(IOException e)
{
System.out.println(e);
}
try
{
os=new PrintStream(c.getOutputStream());
is=new DataInputStream(System.in);
is1=new DataInputStream(c.getInputStream());
while(true)
{
System.out.println("Client:");
line=is.readLine();
os.println(line);
System.out.println("Server:" + is1.readLine());
}
}
catch(IOException e)
{
System.out.println("Socket Closed!");
}
}
}
Output
Server
C:\Program Files\Java\jdk1.5.0\bin>javac EServer.java
Note: EServer.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
C:\Program Files\Java\jdk1.5.0\bin>java EServer
C:\Program Files\Java\jdk1.5.0\bin>
Client
C:\Program Files\Java\jdk1.5.0\bin>javac EClient.java
Note: EClient.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
C:\Program Files\Java\jdk1.5.0\bin>java EClient
Client:
Hai Server
Server:Hai Server
Client:
Hello
Server:Hello
Client:
end
Server:end
Client:
ds
Socket Closed!
EXPERIMENT- 8
ALGORITHM:
1. Create a new file. Enter the domain name and address in that file.
2. To establish the connection between client and server.
3. Compile and execute the program.
4. Enter the domain name as input.
5. The IP address corresponding to the domain name is display on the screen
6. Enter the IP address on the screen.
7. The domain name corresponding to the IP address is display on the screen.
8. Stop the program.
Program Code :
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<netdb.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
int main(int argc,char *argv[1])
{
struct hostent *hen;
if(argc!=2)
{
fprintf(stderr,"Enter the hostname \n");
exit(1);
}
hen=gethostbyname(argv[1]);
if(hen==NULL)
{
fprintf(stderr,"Host not found \n");
}
printf("Hostname is %s \n",hen->h_name);
printf("IP address is %s \n",inet_ntoa(*((struct in_addr *)hen->h_addr)));
}
Output
IP address is 87.248.113.14
ALGORITHM: CLIENT
4. The client accept the connection and to send the data from client to server and vice versa
5. The client communicate the server to send the end of the message
ALGORITHM: SERVER
4. The server accept the connection and to send the data from server to client and vice versa
5. The server communicate the client to send the end of the message
Program :
UDPserver.java
import java.io.*;
import java.net.*;
class UDPserver
{
public static DatagramSocket ds;
public static byte buffer[]=new byte[1024];
public static int clientport=789,serverport=790;
public static void main(String args[])throws Exception
{
ds=new DatagramSocket(clientport);
System.out.println("press ctrl+c to quit the program");
BufferedReader dis=new BufferedReader(new InputStreamReader(System.in));
InetAddress ia=InetAddress.getByName("localhost");
while(true)
{
DatagramPacket p=new DatagramPacket(buffer,buffer.length);
ds.receive(p);
String psx=new String(p.getData(),0,p.getLength());
System.out.println("Client:" + psx);
System.out.println("Server:");
String str=dis.readLine();
if(str.equals("end"))
break;
buffer=str.getBytes();
ds.send(new DatagramPacket(buffer,str.length(),ia,serverport));
}
}
}
UDPclient.java
import java .io.*;
import java.net.*;
class UDPclient
{
public static DatagramSocket ds;
public static int clientport=789,serverport=790;
public static void main(String args[])throws Exception
{
byte buffer[]=new byte[1024];
ds=new DatagramSocket(serverport);
BufferedReader dis=new BufferedReader(new InputStreamReader(System.in));
System.out.println("server waiting");
InetAddress ia=InetAddress.getByName("10.0.200.36");
while(true)
{
System.out.println("Client:");
String str=dis.readLine();
if(str.equals("end"))
break;
buffer=str.getBytes();
ds.send(new DatagramPacket(buffer,str.length(),ia,clientport));
DatagramPacket p=new DatagramPacket(buffer,buffer.length);
ds.receive(p);
String psx=new String(p.getData(),0,p.getLength());
System.out.println("Server:" + psx);
}
}
}
Output:
Server
C:\Program Files\Java\jdk1.5.0\bin>javac UDPserver.java
C:\Program Files\Java\jdk1.5.0\bin>java UDPserver
press ctrl+c to quit the program
Client:Hai Server
Server:
Hello Client
Client:How are You
Server:
I am Fine what about you
Client
C:\Program Files\Java\jdk1.5.0\bin>javac UDPclient.java
C:\Program Files\Java\jdk1.5.0\bin>java UDPclient
server waiting
Client:
Hai Server
Server:Hello Clie
Client:
How are You
Server:I am Fine w
Client:
end
EXPERIMENT- 9
Program Objective : To implement programs using raw sockets (like packet capturing and filtering)
Program Prerequisites: System installed with C and JAVA compiler (512 MB RAM, 32GB HDD)
ALGORITHM :
6. And using TCP\IP communication to enter the Source IP and port number and Target IP address and port
number.
7. The Raw socket () is created and accept the Socket ( ) and Send to ( ), ACK
Program Code:
//---cat rawtcp.c---
// Run as root or SUID 0, just datagram no data/payload
#include <unistd.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
// Packet length
#define PCKT_LEN 8192
memset(buffer, 0, PCKT_LEN);
if(argc != 5)
{
printf("- Invalid parameters!!!\n");
printf("- Usage: %s <source hostname/IP> <source port> <target hostname/IP> <target port>\n", argv[0]);
exit(-1);
}
// Source IP, modify as needed, spoofed, we accept through command line argument
ip->iph_sourceip = inet_addr(argv[1]);
// Destination IP, modify as needed, but here we accept through command line argument
ip->iph_destip = inet_addr(argv[3]);
// The TCP structure. The source port, spoofed, we accept through the command line
tcp->tcph_srcport = htons(atoi(argv[2]));
// The destination port, we accept through command line
tcp->tcph_destport = htons(atoi(argv[4]));
tcp->tcph_seqnum = htonl(1);
tcp->tcph_acknum = 0;
tcp->tcph_offset = 5;
tcp->tcph_syn = 1;
tcp->tcph_ack = 0;
tcp->tcph_win = htons(32767);
tcp->tcph_chksum = 0; // Done by kernel
tcp->tcph_urgptr = 0;
// IP checksum calculation
ip->iph_chksum = csum((unsigned short *) buffer, (sizeof(struct ipheader) + sizeof(struct tcpheader)));
// Inform the kernel do not fill up the headers' structure, we fabricated our own
if(setsockopt(sd, IPPROTO_IP, IP_HDRINCL, val, sizeof(one)) < 0)
{
perror("setsockopt() error");
exit(-1);
}
else
printf("setsockopt() is OK\n");
printf("Using:::::Source IP: %s port: %u, Target IP: %s port: %u.\n", argv[1], atoi(argv[2]), argv[3],
atoi(argv[4]));
// sendto() loop, send every 2 second for 50 counts
unsigned int count;
for(count = 0; count < 20; count++)
{
if(sendto(sd, buffer, ip->iph_len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0)
// Verify
{
perror("sendto() error");
exit(-1);
}
else
printf("Count #%u - sendto() is OK\n", count);
sleep(2);
}
close(sd);
return 0;
}
OUT PUT :
[exam03@localhost 03]# gcc rawtcp.c -o rawtcp
[exam03@localhost 03]# ./rawtcp
- Invalid parameters!!!
- Usage: ./rawtcp <source hostname/IP> <source port> <target hostname/IP> <target port>
[exam03@localhost 03]# ./rawtcp 10.10.10.100 23 203.106.93.88 8008
socket()-SOCK_RAW and tcp protocol is OK.
setsockopt() is OK
Using:::::Source IP: 10.10.10.100 port: 23, Target IP: 203.106.93.88 port: 8008.
Count #0 - sendto() is OK
Count #1 - sendto() is OK
Count #2 - sendto() is OK
Count #3 - sendto() is OK
Count #4 - sendto() is OK
EXPERIMENT- 10
Objective: Write a program using RPC/RMI.
Description
Remote Procedure Call (RPC) system enables you to call a function available on a remote server using the
same syntax which is used when calling a function in a local library. This is useful in two situations.
You can utilize the processing power from multiple machines using rpc without changing the code for
making the call to the programs located in the remote systems.
The data needed for the processing is available only in the remote system.
So in python we can treat one machine as a server and another machine as a client which will make a call to
the server to run the remote procedure. In our example we will take the localhost and use it as both a server
and client.
Running a Server
The python language comes with an in-built server which we can run as a local server. The script to run this
server is located under the bin folder of python installation and named as classic.py. We can run it in the
python prompt and check its running as a local server.
python bin/classic.py
When we run the above program, we get the following output −
INFO:SLAVE/18812:server started on [127.0.0.1]:18812
Running a Client
Next we run the client using the rpyc module to execute a remote procedure call. In the below example we
execute the print function in the remote server.
import rpyc
conn = rpyc.classic.connect("localhost")
conn.execute("print('Hello from Tutorialspoint')")
When we run the above program, we get the following output −
Hello from Tutorialspoint
Expression Evaluation through RPC
Using the above code examples we can use python’s in-built functions for execution and evaluation of
expressions through rpc.
import rpyc
conn = rpyc.classic.connect("localhost")
conn.execute('import math')
conn.eval('2*math.pi')
When we run the above program, we get the following output −
6.283185307179586
Method 2:
ALGORITHM:
3. Using Add server() to implement and Call the Add server impl
Program Code:
ADD CLIENT:
import java.rmi.*;
public class AddClient
{
public static void main(String args[])
{
try
{
String addServerURL="rmi://"+args[0]+"/AddServer";
AddServerIntf addServerIntf=(AddServerIntf)Naming.lookup(addServerURL);
System.out.println("the first number is"+args[1]);
double d1=Double.valueOf(args[1]).doubleValue( );
System.out.println("the Second number is"+args[2]);
double d2=Double.valueOf(args[2]).doubleValue();
System.out.println("the sum is "+addServerIntf.add(d1,d2));
}
catch(Exception e)
{
System.out.println("Exception:"+e);
}
}
}
ADD SERVER
import java.net.*;
import java.rmi.*;
public class AddServer
{
public static void main(String args[])
{
try
{
AddServerImpl addServerImpl=new AddServerImpl();
Naming.rebind("AddServer",addServerImpl);
}
catch(Exception e)
{
System.out.println("Exception :"+e);
}
}
}
ADD SERVERIMPL:
import java.rmi.*;
import java.rmi.server.*;
public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf
{
public AddServerImpl()throws RemoteException
{
}
public double add(double d1,double d2)throws RemoteException
{
return d1+d2;
}
}
ADDSERVERINTF:
import java.rmi.*;
public interface AddServerIntf extends Remote
{
double add(double d1,double d2)throws RemoteException;
}
OUTPUT:
Computer Networks Lab Viva Questions
1. Define a network.
A network is a collection of networks joined together by physical media linkages. Recursively, a network is any
physical link connecting two or more nodes or any two or more networks connected by one or more nodes.
Two or more computers connected directly to one another via a physical media, such as a coaxial cable or optical
fibre, can perform work at the lowest level. A link is an example of a physical medium.
3. Describe a Node.
A network can be made up of two or more computers that are physically linked together, such as by coaxial cable or
optical fibre. Such physical media is known as a link, and the computer that connects to it is referred to as a node.
A node linked to two or more networks is referred to as a gateway or router. In most cases, it transmits the message
from one network to another.
We refer to physical connections as point-to-point links if they can only connect two nodes.
If two or more nodes share the physical links, it is referred to as multiple accesses.
8. What are the names of the variables that impact the performance of the network?
Hardware, software, users, and various transmission mediums are all factors.
Reliability:
The amount of time it takes a link to recover from a failure, how often failures occur, and how robust the network is are
all indicators of how reliable a system is.
Security:
Security concerns include guarding data from viruses and illegal access.
Performance:
A network's performance can be evaluated in a number of ways, including through metrics like reaction time and
transmit time.
10. Talk about the elements that affect the network's dependability.
There are mainly two elements that affect the network's dependability:
o Frequency of failures;
o Network recovery time after a failure.
11. What are the factors that affect the security of the network?
There are several factors that affect network security, including viruses, unauthorized access, and many more.
12. What is the protocol?
Semantics:
The format and structure of the data, or the manner in which they are presented, make up a protocol's syntax.
Timing:
Latency and bandwidth are used to gauge the network's performance. The number of beads that may be transmitted
through the network in a specific amount of time is referred to as the network's bandwidth. In
contrast, latency describes the length of time it takes a message to transit over a network in terms of bits.
16. Talk about routing.
The act of methodically forwarding a message to a destination node depending on its address is known as routing in a
network.
Each process that communicates between machines at a specific network layer is known as a peer-to-peer process.
A switch may receive packets quicker than a card link that can hold them and store them in memory for a longer amount
of time. If this occurs, the switch may eventually run out of buffer space, forcing some packets from it to be lost in a
particular state. The situation of the network is referred to as the "congested condition of the network".
Understanding the requirement applications and being aware of the technological constraints might help to define a
useful channel. Therefore, the gap between application characteristics and the underlying technology can be described
as the semantic gap in the network.
The Round-trip time is the amount of time it takes to send a message from one end of a network to the other and vice
versa.
Multicasting is a method by which the message is sent to some subset of other nodes.
Unicasting is a method by which the message is sent from a source to a single destination node.
Finally, broadcasting is a method by which the message is sent to all the nodes in the network.
Multiplexing is the process through which numerous signals are sent simultaneously over a single data channel.
o Synchronous TDM
o Asynchronous TDM or statistical TDM
FDM is an analogue method that can be used when a link's bandwidth is greater than the total bandwidth of the signals
to be transferred.
This method is comparable to FDM. Additionally, multiplexing and demultiplexing include the transmission of light
signals across fibre optic channels.
TDM involves digital technology, and it can be used when the transmission medium's data rate capacity exceeds the
data rate needed by the transmitting and receiving devices.
27. Discuss Synchronous TDM.
The multiplexer always assigns each device the exact same time slot in the synchronous time division multiplexing
technique. The device might or might not have anything to communicate.
1. Physical layer
2. Datalink layer
3. Network layer
4. Transport layer
5. Session layer
6. Presentation layer
7. Application layer
1. Network layer
2. Physical layer
3. Datalink layer
1. Application layer
2. Presentation layer
3. Session layer
31. Which layer in the OSI stack connects the user-supported and network-supported layers?
The user-supported layer and the network-supported layer are connected via the transport layer.
The physical layer coordinates the operations necessary for the transmission of a bit stream across a physical medium.
1. Representation of bits
2. physical characteristics of interfaces and media
3. data rate
4. bits synchronization
5. a line configuration
6. transmission mode
7. physical topology
The data link layer transmits information to the physical layer. The data link layer is in charge of node-to-node
distribution and conveys a raw facility to a dependable link.
o physical addressing
o flow control
o framing
o error control
o access control
34. Explain the functions of the network layer.
The transport layer is in charge of sending the full message from source to destination. Some other functions of the
transport layer are,
1. Connection control
2. error control
3. segmentation and reassembly
4. service point addressing
5. flow control
The network dialogue controller is treated as a session layer. It upholds, establishes, and synchronizes communication
between systems.
o Synchronization
o Dialogue management
The presentation layer is in charge of sharing information on the syntax and semantics between two systems. Other
functions include translation, encryption, and compression.
38. Describe the responsibility of the application layer.
The application layer decides whether software or humans will access the network. The application layer provides user
interfaces and supports, like shared database management, e-mail, and other types of distributed Information Services.
There are two categories of hardware components, i.e., Nodes and Links.
40. What different kinds of links can be employed to construct a computer network?
o leased lines
o Cables
o last mile links
o wireless links
I) guided media
1. shielded TP
2. Unshielded TP
B) coaxial cable
1. terrestrial microwave
2. Satellite communication
o Single bit error: In this error, only one bit in the data unit is altered.
o Burst error: two or more data bits will be altered in this error.
43. What is computer network error detection, and what are its methods?
During transmission, there may be the possibility of corruption of data. For reliable communication, errors must be
deducted and corrected. The concept of redundancy is used by error detection in a computer network, which means
adding extra bits to detect errors at the destination. There are some common error detection methods which are as
follows
Redundancy is a method by which we might transmit more information merely for comparison purposes.
It is one of the simplest and most prevalent procedures used in mistake detection techniques. In vertical redundancy
check, a parity bit is added to every data unit so that the total number of 1s becomes even for even parity. It has a single-
bit error detection capability and can only detect burst faults if there are an odd number of overall errors in each data
unit.
46. How do you perform a longitudinal redundancy check?
In the longitudinal redundancy check, bits are broken up into blocks called rows, and a redundant row of bits is added
to the original block. It is capable of detecting burst mistakes. Let's say two bits in a data unit are broken, and bits in the
exact same locations in another data unit are likewise broken. In that situation, the longitudinal redundancy checker
won't pick up on a mistake. The data unit comes after n data units in the logical redundancy check.
It is one of the most powerful redundancy-checking methods. The cyclic redundancy check is based on binary division.
The checksum approach is used by higher layer protocols to assist with error detection.
Data link protocols refer to the set of specifications required to implement the data link layer. The following are some
categories of data link protocols:
A. Asynchronous protocol
B. Synchronous protocol
1. Character-oriented protocol
2. Bit oriented protocol
51. What is the difference between error correction and error detection?
Error detection is easy and simple than error correction, and it is examined for error detection when any error occurs.
Additionally, only the corrupted bits are verified during error correction. The number of mistakes and the size of the
messages is key components in key correction.
Forward error detection is the method through which the receiver makes an attempt to understand the message using
redundant bits.
Retransmission is the process by which a message is requested to be sent again after an error has been found by the
recipient. The message is sent again and again until it is received and the recipient accepts it as an error-free
transmission.
The messages are separated into blocks when using block coding. A data word is referred to as each of the K beats.
Block coding is a one-to-one method, and the same data word is consistently encoded using the same code word.
Each block is given an additional "r" redundant bit to make the length n = k + r. These resultant n-bit blocks are known
as codewords. The codewords 2n and 2k are rarely used, and these terms have no legitimate use.
A linear block code is one in which another valid code word is created by the exclusive OR of two valid code words.
It is a program or device that applies specified algorithms to video or audio data to compress or encode it for usage in
storage or transmission. Analog video to digital video conversion is accomplished with this circuit.
The encoded data is translated into its original format by a program or device. This expression is frequently used to
describe MPEG-2 sound and video data, which needs to be encoded before output.
Framing is the process by which the data connection layer divides a message into its additional centre address and
destination address while it is being sent from one source to another or from one destination to another. The sender
address enables the recipient to acknowledge receipt of the packet, and the destination address specifies where the
packet must go.
In fixed-size framing, the frame borders are not specified. A delimiter could be the size itself.
The character stuffing or bite stuffing approach involves adding a special kind of byte to the frame's data section along
with a character or pattern that matches the flag. The data area is filled with the aid of an additional byte. This bite is
frequently referred to as the escape character, which has a predetermined bit pattern. When the receiver comes across
the escape character, it is deleted from the data section and it sees the following character as data rather than a
delimiting indicator.
Flow control refers to a collection of methods that is used to limit how much data a sender can send before having to
wait for an acknowledgment.
Error control is the combination of error detection and correction. It allows the receiver to inform the sender of any
frames lost or damaged and transmission, and it coordinates the transmission of those frames by the sender. In the data
link layer, error detection is referred to as "error control and retransmission methods".
Error control is the combination of error detection and correction. The data link layer frequently implements error
control. When an exchange error is discovered, the required programmes are sent again. An automatic repeat request
(ARQ) is the name given to the entire process.
In the stop-and-wait protocol, the sender sends the first frame and waits for the receiver to affirm, "OK, go ahead",
before sending the next frame.
By keeping the copy of the sent frame, the error correction is done in a stop-and-wait automatic repeat request, and
when the timer expires, the transmission of the frame is done.
Pipelining is a networking technique or other application where a task frequently starts before the previous activity has
finished.
The range of sequence numbers is described by an abstract idea. Also, it is a concern of the sender and receiver. On the
other hand, the receiver and the sender should deal with it if they only have access to a portion of the possible sequence
number.
Piggybacking is the term for the method that is used to increase the effectiveness of more extensive external treatments.
A frame can control information about lost frames from Q when it conveys data from P to Q, and it can control
information about the arrived frame from P when it carries data from Q to P.
a. Point to point
b. Broadcast
The subnet is a generic term that is used for the section of a large network, usually separated by a bridge or a router.
75. What are the differences between transmission and communication?
Communication defines the full exchange of information between two communication media.
a. Simplex
b. Half duplex
c. Full duplex
It is a series of interface points that allows other computers to communicate with other network protocol stack layers.
A document called X.3 describes the function of a packet assembler disassembler. The standard protocol has been
defined between the PAD and terminal called X.28, and another standard protocol exists between the network and PAD
known as X.29. These three combined are recommended as triple X.
Terminal emulation is called telnet, and it comes under the application layer.
81. Define beaconing.
Beaconing is a process in which it permeates a network to self-repair the problems in that network. The network on the
station alerts the other stations in the ring when these are not receiving the transmission. In addition, it is utilised
in token rings and FDDI networks.
It is software that converts files into network requests, prints I/O requests, or intercepts files. It belongs to the
presentation layer.
NETBEUI:
It is the netbios programming interface's extended user interface. Companies like Microsoft and IBM created this
transport protocol for the use of tiny subnets.
NETBIOS:
It is a programming interface that enables I/O requests to be sent and received from remote computers while concealing
the networking hardware from applications.
Multiple hard discs are used in this strategy to provide fault tolerance.
When the computers on the network listen and receive the signal, the signals we call are passive. It is because they
increase the signal's volume. The best illustration of passive topology is the linear bus.
It is a communication protocol. It is used to connect computers to remote networking services, including Internet service
providers.
At the upper levels of the OSI model, a gateway always operates, and it translates information between two completely
different data formats or network architectures.
For a device, the address is defined at the media access control (Mac) layer in the network architecture. Mac address is
unique. It's usually stored in ROM on the network.
90. What is the difference between bit rate and baud rate?
The number of bits transmitted during one second is called as Bit rate. At the same time, the number of signal units per
second required to represent those bits is called the baud rate.
Usually, signals are transmitted over some transmission media. These transmission media are basically classified into
two categories;
A. Guided media:
In guided media, it conducts conduction between one device to another, including twisted pair, fiber optic cable, and a
coaxial cable. The signal which travels along any of these media is directed and is contained by the physical limits of
the medium. Coaxial cable and twisted pair use metallic that accepts and transports signals in the form of electrical
current. In the form of light, the optical fiber, which is a Plastic or a glass cable, transports under accepted signals?
B. Unguided media:
It is a wireless media. It transports electromagnetic waves without the help of a physical conductor. These are done
through satellite communication, radio communication, and cellular telephony.
It is a project that is started by IEEE. It has started to set standards to enable intercommunication between equipment
from various manufacturers. To allow the interconnectivity of major LAN protocols, it is preferred to specify functions
after the physical layer, the data link layer, and the person's extent to the network layer.
A. For compatibility of different mans and lans across protocols, 802.1 is an internal networking standard.
B. 802.3 is the logical link control (LLC), the upper sublayer of the datalink layer, which is non-architecture specific. It
remains the same for all IEEE-defined lans.
C. The lower sublayer of the data link layer, which is media access control, contains some distinct modules, each
carrying proprietary information specific to the LAN product being used. These modules are Ethernet LAN, i.e., 802.3,
a token ring LAN, i.e., 802.4, and a token bus LAN, i.e., 802.5.
The protocol data unit (PDU) is the data unit at the LLC level. Four fields are contained by the protocol data units: a
source service access point (SSAP), a destination service access point (DSAP), a control field, and an information field.
Source service access point and destination service access point add the addresses which are used by LLC for
identification of the protocol stacks and the receiving and sending machines that generate and use the data. Whether the
PDU frame is an information frame or a supervisory frame, or an unnumbered frame is specified by the control field.
The Repeater is also called a regenerator. It is an electronic device that operates only at the physical layer. Before it
becomes weak, it receives the signal in the network, regenerates the signal bit pattern, and puts the refreshed copy back
into the link.
B. Bridges:
Bridges operate in both the data link layer and physical layer of lans of the same type. A large network is divided by the
bridges into smaller segments. Bridges contain logic that allows them to keep the traffic for each segment separate, and
for that, the repeaters relay frame inside the segment containing the intended recipient and control congestion.
C. Routers:
Among multiple interconnected networks, the packets are relayed by the routers. Routers operate in data link, physical,
and network layers. Router's content software enables them to the determination of several possible paths, i.e., which
path is best for a particular transmission.
D. Gateway:
A gateway is a networked device that acts as an entry point into another network when discussing networking (network
devices gateway). For example, a wireless router is typically utilized as the default gateway in a home network. In a
nutshell, a gateway serves as a messenger agent, receiving data from one network, interpreting it, and transmitting it to
another. Gateways may function at any layer of the OSI model and are also known as protocol converters.
ICMP stands for "Internet control message protocol". It is a network layer protocol of the TCP/IP protocol that is
used by hosts and gateways for sending notifications of datagram problems back to the sender. ICMP uses an echo test
or reply to test whether a destination is reachable and responding. ICMP handles both control and error messages.
96. Describe the data units at different TCP/ IP protocol suite layers.
The message is the data unit that is created at the application layer. A segment or a user datagram is the data unit that is
created at the transport layer. At the network layer, the datagram unit is created. At the data link layer, the datagram is
encapsulated and finally transmitted as signals along the transmission media.
On the other hand, The reverse address resolution protocol (RARP) permits a host to discover its Internet address when
it knows only its physical address.
98. What is the minimum and maximum length of the header in the TCP segmentand the IP datagram?
There should be a minimum length of the header of up to 20 bytes, and the length can have a maximum of 60 bytes.
100. What are the differences between FTP and TFTF application layer protocols?
The file transfer protocol is one of the standard mechanisms provided by TCP IP for the purpose of a copy of a file from
one host to another. It is very secure and reliable. It uses the services offered by TCP. Two connections are established
between the host, which is one for data transfer and another for control information.
The trivial file transfer protocol (TFTP) lodges a local host open files from a remote host. But here, the host does not
provide reliability or security. Fundamental packet delivery services are used by TFTP, which is offered by UDP.
1. Peer-to-peer network:
In this type of network, the computers can act as the client using the resources, and servers share the resources.
2. Server-based network:
In this network, it provides centralized control of network resources which rely on server computers for providing
security and network administration.
1. Star topology:
In the star topology network, all computers had connected using a central hub. It can be inexpensive. It is very easy to
install, and then we can easily reconfigure it, and it is very easy to detect physical problems.
2. Bus topology:
In this topology network, each computer is directly connected to a primary network cable with the help of a single line.
It is also inexpensive, and it is very easy to install. We can understand it simply, and they can extend easily.
3. Ring topology:
In this topology, all the computers are connected in a loop. In this, the computers have equal access to network media.
In this system, the installation process is simple. As much as in other topologies, the signal does not degrade because
each computer regenerates it.
In the mesh network, there are multiple network links available. This network links the computers to provide multiple
paths to travel for the data.
According to broadband transmission on multiple frequencies, the signals are sent by allowing multiple signals
simultaneously.
On the other hand, a single cable consumes the entire bandwidth of the cable in baseband transmission.
105. What is the 5-4-3 rule?
In the Ethernet network, there cannot be more than five network segments between any two points on the network. In
the same way, there cannot be four repeaters, well. Only three of segments upper pipe segments can be populated.
The hub is called the multistation access unit (MAU) in the token ring.
A routing protocol is a network protocol that transports data from one network to another via a router and is delivered to
a system on that remote network. On the other hand, the data from a non-routable protocol cannot be routed through a
router. It is primarily due to the protocol's lack of capacity.
OSI reference model provides a framework for discussing network design and operations.
The logical link control (LLC) is the highest sublayer of the data link layer in the open system interconnections (OSI)
data transmission reference model. It serves as an interface between the network layer and the data link layer's media
access control (MAC) sublayer.
It is a connection from one source to one destination. However, multicast connections are also permitted. The circuit is
another name for a virtual channel.
111. Define the virtual path.
A group of virtual circuits can be grouped together along any transmission path from a given source to the destination.
This destination path is called a virtual path.
Packet filtering is a firewall technique that is utilized for controlling network access by monitoring outgoing and
incoming packets and enabling them to pass or fail based on the source and destination IP addresses, protocols, and
ports.
Multicast routing is a networking technique for distributing one-to-many traffic efficiently. A multicast source transmits
traffic to a multicast group in a single stream like a live video conference. Receivers in the multicast group include
computers, gadgets, and IP phones.
Silly Window Syndrome is a problem caused by bad TCP implementation. It reduces TCP throughput and renders data
delivery wasteful.