Computer Networks Questions Solution
Computer Networks Questions Solution
Faculty Name:
o Assistant Professor: Bhaumik Gelani
55. Explain Functions of Data Link Layer and List out Services of Data Link
Layer.
56. What is Error Detection? Explain Types of Errors.
OR
Q. Explain Single-Bit Error and Burst Error.
57. What is Error Detection? Explain Error Detecting Techniques.
OR
Q. Explain Single parity check and Two-dimensional parity check.
Q. Explain Checksum and Cyclic redundancy check.
58. Write a short note: Hamming Code.
59. Write a short note: High-Level Data Link Control (HDLC).
OR
Q. Draw and Explain HDLC frame format.
60. Explain HDLC frames types.
61. Write a short note: Multiple Access Protocols.
OR
Q. What is Aloha Protocol? Explain Types of Aloha Protocols.
Q. Explain Channelization Protocols (FDMA, TDMA and CDMA).
Q. Write a short note: CSMA (Carrier Sense Multiple Access).
Q. Write a short note: CSMA/CD and CSMA/CA.
62. Explain Ethernet (IEEE standards 802.3).
63. Explain Token bus (IEEE standards 802.4) and Token ring (IEEE
standards 802.5)
64. Write a short note: FDDI and DQDB (IEEE standards 802.6).
65. Write a short note: VLAN (Virtual Local Area Network).
Faculty Name:
o Assistant Professor: Bhaumik Gelani
o When a node wants to send a message over the network, it puts a message over the
network.
o All the stations available in the network will receive the message whether it has
been addressed or not.
o The bus topology is mainly used in 802.3 (ethernet) and 802.4 standard networks.
o The configuration of a bus topology is quite simpler as compared to other
topologies.
o The backbone cable is considered as a "single lane" through which the message is
broadcast to all the stations.
o It does not contain the switch, hub or any central computer which acts as a central
point of communication.
o The Internet is an example of the mesh topology.
o Mesh topology is mainly used for WAN implementations where communication
failures are a critical concern.
o Mesh topology is mainly used for wireless networks.
o Advantages of Mesh topology:
Reliable:
The mesh topology networks are very reliable as if any link
breakdown will not affect the communication between connected
computers.
Fast Communication:
Communication is very fast between the nodes.
Easier Reconfiguration:
Adding new devices would not disrupt the communication between
other devices.
o Disadvantages of Mesh topology:
Cost:
A mesh topology contains a large number of connected devices such
as a router and more transmission media than other topologies.
Management:
Mesh topology networks are very large and very difficult to maintain
and manage.
Tree Topology:
o Tree topology combines the characteristics of bus topology and star topology.
o A tree topology is a type of structure in which all the computers are connected with
each other in hierarchical fashion.
o The top-most node in tree topology is known as a root node, and all other nodes are
the descendants of the root node.
o There is only one path exists between two nodes for the data transmission. Thus, it
forms a parent-child hierarchy.
o Advantages of Tree topology:
Easily expandable:
We can add the new device to the existing network.
Therefore, we can say that tree topology is easily expandable.
Error detection:
Error detection and error correction are very easy in a tree topology.
Limited failure:
The breakdown in one station does not affect the entire network.
Point-to-point wiring:
It has point-to-point wiring for individual segments.
o Disadvantages of Tree topology:
Difficult troubleshooting:
If any fault occurs in the node, then it becomes difficult to
troubleshoot the problem.
High cost:
Devices required for broadband transmission are very costly.
Failure:
A tree topology mainly relies on main bus cable and failure in main
bus cable will damage the overall network.
Hybrid Topology:
A shielded twisted pair is a cable that contains the mesh surrounding the
wire that allows the higher transmission rate.
An extra metallic shield on each pair.
Relatively more expensive.
Better performance than UTP.
Coaxial Cable:
Fiber-optic cable:
o Fibre optic cable is a cable that uses electrical signals for communication.
o Fibre optic is a cable that holds the optical fibers coated in plastic that are used to
send the data by pulses of light.
o Fibre optics provide faster data transmission than copper wires.
o Highly regulated
o Omnidirectional antennas
o Radio waves are used for multicast communications, such as radio and television,
and paging systems
o Penetrate through walls
Micro Wave:
o Infrared signals can be used for short-range communication in a closed area using
line-of-sight propagation
o Used on Televisions, DVDs, and stereos all use infrared communication.
o Cheap, Easy to build but they do not pass through solid objects
o Relatively directional
Circuit switching:
o Communication via circuit switching involves three phases:
Circuit Establishment
Data Transfer
Circuit Disconnect
o Circuit-Switched Networks:
o Packets will travel across the network, taking the shortest path as possible.
o All the packets are reassembled at the receiving end in correct order.
o If any packet is missing or corrupted, then the message will be sent to resend the
message.
o If the correct order of the packets is reached, then the acknowledgment message
will be sent.
o There are two approaches to Packet Switching:
Datagram Packet switching
Virtual Circuit Switching
o Datagram Packet switching:
It is a packet switching technology in which packet is known as a datagram.
Datagram Packet Switching is also known as connectionless switching.
The packets are reassembled at the receiving end in correct order.
In Datagram Packet Switching technique, the path is not fixed.
Intermediate nodes take the routing decisions to forward the packets.
o Virtual Circuit Switching:
Virtual Circuit Switching is also known as connection-oriented switching.
In the case of Virtual circuit switching, a preplanned route is established
before the messages are sent.
Call request and call accept packets are used to establish the connection
between sender and receiver.
In this case, the path is fixed for the duration of a logical connection.
Physical layer
o The physical layer is responsible for movements of individual bits from one hop
(node) to the next.
Data link layer
o The data link layer is responsible for moving frames from one hop (node) to the
next.
o Groups of bits its called Frame.
Network layer
o The network layer is responsible for the delivery of individual packets from the
source host to the destination host.
o Groups of Frame its called Packets.
Presentation layer
o The presentation layer is responsible for translation, compression, and encryption.
o Data translation ,compression and encryption.
o Encrypt data to hide it.
o Compress data from last message to small no of messages.
Application layer
o The application layer is responsible for providing services to the user.
o Login password checking, file transfer are some of the application.
o Provide direct access to network device.
o Interface between user and system.
o Examples: File transfer, Emails, www
Physical layer
o The physical layer is responsible for movements of individual bits from one hop
(node) to the next.
Data link layer
o The data link layer is responsible for moving frames from one hop (node) to the
next.
o Groups of bits its called Frame.
Network layer
o The network layer is responsible for the delivery of individual packets from the
source host to the destination host.
o Groups of Frame its called Packets.
o Network layer protocols : IP, ICMP, ARP and RARP.
o IP ( Internetwork Protocol):
IP is transmission mechanism used. It is connectionless and unreliable
protocol. packets in the IP layer called datagram.
o ICMP (Internet Control Message Protocol):
ICMP used to handle, control and error message in the IP layer.
Types of Delays:
Processing Delay
o The time required to examine the packet sheared and determine where to direct the
packet.
o To check bit level error.
o Determine output link.
o Delay in terms of microseconds.
Working:
Bridge:
Working of E-mail:
o Email working follows the client server approach. In this client is the mailer i.e. the
mail application or mail program and server is a device that manages emails.
o Following example will take you through the basic steps involved in sending and
receiving emails and will give you a better understanding of working of email
system:
Suppose person A wants to send an email message to person B.
Person A composes the messages using a mailer program i.e. mail client and
then select Send option.
The message is routed to Simple Mail Transfer Protocol to person B’s
mail server.
The mail server stores the email message on disk in an area designated for
person B.
Now, suppose person B is running a POP client and knows how to
communicate with B’s mail server.
It will periodically poll the POP server to check if any new email has arrived
for B.As in this case, person B has sent an email for person B, so email is
forwarded over the network to B’s PC. This is message is now stored on
person B’s PC.
o Components of SMTP:
First, we will break the SMTP client and SMTP server into two
components such as user agent (UA) and mail transfer agent (MTA).
The user agent (UA) prepares the message, creates the envelope and then
puts the message in the envelope. The mail transfer agent (MTA) transfers
this mail across the internet.
o The relaying system without TCP/IP protocol can also be used to send the emails
to users, and this is achieved by the use of the mail gateway.
o The mail gateway is a relay MTA that can be used to receive an email.
o MIME Header:
MIME adds five additional fields to the header portion of the actual e-mail
to extend the properties of the simple email protocol.
o Content-Type:
Type of data used in the body of the message.
They are of different types like text data (plain, HTML), audio content, or
video content.
o Content-Type Encoding:
It defines the method used for encoding the message.
Like 7-bit encoding, 8-bit encoding, etc.
o Content Id:
It is used for uniquely identifying the message.
o Content description:
It defines whether the body is actually an image, video, or audio.
o MIME-Version:
Defines the version of the MIME protocol.
It must have the parameter Value 1.0, which indicates that message is
formatted using MIME.
o Content-Type:
Type of data used in the body of the message.
They are of different types like text data (plain, HTML), audio content, or
video content.
o Content-Type Encoding:
It defines the method used for encoding the message.
Like 7-bit encoding, 8-bit encoding, etc.
o Content Id:
It is used for uniquely identifying the message.
o Content description:
It defines whether the body is actually an image, video, or audio.
POP3 and IMAP are the protocols that are used to retrieve mail from the mailbox at the
mail server to the recipient’s computer. Both are message accessing agents (MAA).
The two protocols POP3 and IMAP are used when both the sender and recipient of mail
are connected to the mail server by WAN or LAN.
The SMTP protocol transfers the mail from client’s computer to the mail server and
from one mail server to another mail server.
POP3 has a limited functionality whereas, the IMAP has extra features over POP3.
IMAP follows Client-server Architecture and is the most commonly used email
protocol.
It is a combination of client and server process running on other computers that are
connected through a network.
This protocol resides over the TCP/IP protocol for communication.
Once the communication is set up the server listens on port 143 by default which is
non-encrypted.
For the secure encrypted communication port, 993 is used.
Control Connection:
o The control connection uses very simple rules for communication.
o Through control connection, we can transfer a line of command or line of response
at a time.
o The control connection is made between the control processes.
o The control connection remains connected during the entire interactive FTP session.
Data Connection:
o The Data Connection uses very complex rules as data types may vary.
o The data connection is made between data transfer processes.
o The data connection opens when a command comes for transferring the files and
closes when the file is transferred.
o SNMP Manager:
It is a computer system that monitors network traffic by the SNMP agent,
and it queries these agents, takes answers, and controls them.
o SNMP Agent:
It is a software program that is located in a network element.
It collects real-time information from the device and passes this information
to the SNMP manager.
o Management components
It has two components
SMI
MIB
o SNMP:
It defines the structure of packets that is shared between a manager and an
agent.
o SMI (Structure of Management Information):
SMI is a network management component that defines the standard rules for
the naming object and object type (including range and length) and also
shows how to encode objects and values.
o MIB (Management Information Base):
MIB is the second component of the network management.
It is virtual information storage where management information is stored.
HTTP:
o HTTP is one of the protocols used at the Application Layer.
o The HTTP is similar to FTP because HTTP is used to transfer the files and it
mainly uses the services of TCP.
o Also, HTTP is much simpler than FTP because there is only one TCP connection.
o In HTTP, there is no separate control connection, as only data is transferred
between the client and the server.
o SMTP messages are stored and then forwarded while the HTTP messages
are delivered immediately.
o The HTTP mainly uses the services of the TCP on the well-known port that is port
80.
o HTTP is a stateless protocol.
o In HTTP, the client initializes the transaction by sending a request message, and
the server replies by sending a response.
o Working of HTTP:
Request Type
o This field is used in the request line.
o The are several request types that are defined and these are mentioned in the table
given below;
URL:
o URL is a Uniform Resource locator and it is mainly a standard way of specifying
any kind of information on the Internet.
HTTP Version:
o The current version of the HTTP is 1.1.
Status Code:
o The status code is the field of the response message.The status code consists of three
digits.
Status Phrase:
o This field is also used in the response message and it is used to explain the status
code in the form of text.
Types of DNS:
o The domain name space is divided into three different sections:
Generic Domains.
Country Domains.
Inverse Domain.
Generic Domains:
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS database.
o It uses three-character labels, and these labels describe the organization type.
Inverse Domains:
o The inverse domain is used for mapping an address to a name.
o When the server has received a request from the client, and the server contains the files of
only authorized clients.
o To determine whether the client is on the authorized list or not, it sends a query to the DNS
server and ask for mapping an address to the name.
TFTP:
o Trivial File Transfer Protocol (TFTP) is a simple protocol used for transferring
files.
o TFTP uses the User Datagram Protocol (UDP) which enables data to be sent
between communication partners without sharing a fixed connection.
o TFTP is mostly used to read and write files/mail to or from a remote server.
o It is also possible to implement the TFTP based on other protocols.
o TFTP is a simpler version of FTP and it doesn’t have all its functions for example,
you cannot list, delete or rename files or directories on a remote server.
o In fact, TFTP can only be used to send and receive files between the two computers.
o TFTP doesn’t support user authentication and all data is sent in clear text.
TFTP messages:
o The transport layer is responsible for the delivery of a message from one process
to another.
o Transport Layer is the fourth layer from the top in OSI Model which provide
communication services to the application processes that was running on different
hosts.
o Transport Layer provides the services to the session layer and it receives the
services from network layer.
o The services provided by transport layer includes error correction as well as
segmenting and De-segmenting data before and after it's sent on the network.
o Transport layer also provides the flow control functionality and ensures that
segmented data is delivered across the network in the right sequence.
Multiplexing:
o Multiplexing is the process of collecting the data from multiple application
processes of the sender, enveloping that data with headers and sending them as a
whole to the intended receiver.
o In Multiplexing at the Transport Layer, the data is collected from various
application processes. These segments contain the source port number, destination
port number, header files, and data.
o These segments are passed to the Network Layer which adds the source and
destination IP address to get the datagram.
Demultiplexing
o Delivering the received segments at the receiver side to the correct app layer
processes is called demultiplexing.
o UDP port number fields are each 16 bits long, therefore range for port numbers
defined from 0 to 65535; port number 0 is reserved.
o Port numbers help to distinguish different user requests or process.
o Source port address:
It defines the address of the application process that has delivered a
message.
The source port address is of 16 bits address.
o Destination port address:
It defines the address of the application process that will receive the
message.
The destination port address is of a 16-bit address.
o Total length:
It defines the total length of the user datagram in bytes.
It is a 16-bit field.
o Checksum:
The checksum is a 16-bit field which is used in error detection.
Therefore, the idea of stop and wait protocol in the sender's side is very simple, i.e.,
send one packet at a time, and do not send another packet before receiving the
acknowledgment.
o Receiver side
Rule 1: Receive and then consume the data packet.
Rule 2: When the data packet is consumed, receiver sends the
acknowledgment to the sender.
Stop-and-Wait is a simple protocol used for transmitting data between two devices over
a communication channel.
In this protocol, the sender sends a packet of data to the receiver and then waits for the
receiver to acknowledge the packet before sending the next packet.
The receiver sends an acknowledgement to the sender indicating that the packet has
been received and is error-free.
Problems:
o Lost Data
o Lost Acknowledgement
The sliding window protocol is a method designed in the network model that allows data
exchange more efficiently and within the scope of clearly defined steps in the channel.
This protocol allows sharing multiple data frames from the sender before receiving any
acknowledgment from the receiver side.
Each of the frames in the network model is assigned a sequence number to increase the
transmission efficiency.
Working of the Sliding Window Protocol:
o The working of the sliding window protocol can be divided into two steps sender
steps, and the receiver steps and also some important values are needed in a
network model for smooth transmission of the data frames are:
o Sender and the receiver side
o Window Size
o The total data frames to be transmitted
o Proper sequencing of the frames
Steps for the Sender Side:
o To begin with, the sender side will share data frames with the receiver side per the
window size assigned to the model.
o The sliding window will appear on the frames transmitted over to the receiver side.
o Then the sender will wait for an acknowledgment from the receiver side for the
shared frames, as mentioned in figure 1.
o When the receiver transmits the acknowledgment of the first transmitted frame, the
sliding window will shift from the acknowledged frame.
Steps for the Receiver Side:
o On receiving the data frames from the sender side, the receiver will use the frames
in the network model.
o After the receiver uses the frame, it will transmit the acknowledgement to the sender
side for that data frame.
o Then, the receiver side will receive the next data frame from the sender side, as
mentioned in figure2.
o This process continues until all the frames are transmitted from the sender side to
the receiver side, and the receiver side transmits the acknowledgment of all the
received frames.
Go-Back-N ARQ:
o In Go-Back-N ARQ protocol, if one frame is lost or damaged, then it retransmits
all the frames after which it does not receive the positive ACK.
o Three possibilities can occur for retransmission:
Damaged Frame
Lost Data Frame
Lost Acknowledgement
Damaged Frame:
o When the frame is damaged, then the receiver sends a NAK frame.
o In the above figure, three frames have been transmitted before an error discovered
in the third frame.
o Window Size:
The window is a 16-bit field that defines the size of the window.
o Checksum:
The checksum is a 16-bit field used in error detection.
o Urgent pointer:
If URG flag is set to 1, then this 16-bit field is an offset from the sequence
number indicating that it is a last urgent data byte.
o Options and padding:
It defines the optional fields that convey the additional information to the
receiver.
o Handshake refers to the process to establish connection between the client and
server.
o Handshake is simply defined as the process to establish a communication link.
o To transmit a packet, TCP needs a three way handshake before it starts sending
data.
o The reliable communication in TCP is termed as PAR (Positive Acknowledgement
Re-transmission).
o The positive acknowledgement from the receiver establishes a successful
connection.
o Step 1 (SYN):
In the first step, the client wants to establish a connection with a server, so
it sends a segment with SYN(Synchronize Sequence Number) which
informs the server that the client is likely to start communication and with
what sequence number it starts segments with.
o Step 2 (SYN + ACK):
Server responds to the client request with SYN-ACK signal bits set.
Acknowledgement(ACK) signifies the response of the segment it received
and SYN signifies with what sequence number it is likely to start the
segments with.
o Step 3 (ACK):
In the final part client acknowledges the response of the server and they
both establish a reliable connection with which they will start the actual
data transfer,
a. Firstly, from one side of the connection, either from the client or the server the FIN
flag will be sent as the request for the termination of the connection.
b. In the second step, whoever receives the FIN flag will then be sending an ACK flag
as the acknowledgment for the closing request to the other side.
c. And, at the Later step, the server will also send a FIN flag as the closing signal to
the other side.
d. In the final step, the TCP, who received the final FIN flag, will be sending an ACK
flag as the final Acknowledgement for the suggested connection closing.
Formula:
M*s=C+ρ*s
o Where,
S – is time taken
M – Maximum output rate
ρ – Token arrival rate
C – Capacity of the token bucket in byte
As we can see in the figure, we can see with piggybacking, a single message (ACK +
DATA) over the wire in place of two separate messages.
Piggybacking improves the efficiency of the bidirectional protocols.
o If Host A has both acknowledgment and data, which it wants to send, then the
data frame will be sent with the ack field which contains the sequence number of
the frame.
o If Host A contains only one acknowledgment, then it will wait for some time,
then in the case, if it finds any data frame, it piggybacks the acknowledgment,
otherwise, it will send the ACK frame.
o If Host A left with only a data frame, then it will add the last acknowledgment
to it. Host A can send a data frame with an ack field containing no
acknowledgment bit.
The Network Layer is responsible for facilitating data transfer between two different
networks.
If the two devices communicating are on the same network, then the network layer is
unnecessary.
The network layer breaks up segments from the transport layer into smaller units,
called packets, on the sender’s device, and reassembling these packets on the receiving
device.
Addressing:
o Maintains both the source and destination addresses at the frame header.
o The network layer performs addressing to find out the specific devices on the
network.
Packetizing:
o The network layer works on the conversion of packets those received from its
upper layer.
o This feature is accomplished by Internet Protocol (IP).
Routing:
o Being considered as the major functionality, the network layer chooses the best
path for data transmission from a source point to the destination.
Internetworking:
o Internetworking works to deliver a logical connection across multiple devices.
o Here, the foremost elements are the carrier’s equipment (the connection between
routers through transmission lines) and the customer’s equipment.
o H1 has a direct connection with carrier router ‘A’, while H2 is connected to carrier
router ‘F’ on a LAN connection.
o One of the carrier router ‘F’, is pointed outside the carrier’s equipment as it does
not come under the carrier, whereas considered as protocols, software, and
construction.
o This switching network performs as Transmission of data happens when the host
(H1) with a packet transfers it to the nearby router through LAN (or) point-to-point
connection to the carrier.
o The carrier stores the packet until it completely arrives thus confirms the checksum.
o Then after, the packet is transmitted over the path until H2 is reached.
o A second technique to reduce the routing table and simplify the searching process
is called the network-specific method.
o Here, instead of having an entry for every destination host connected to the same
physical network (host-specific method), we have only one entry that defines the
address of the destination network itself.
o Host-specific routing is used for purposes such as checking the route or providing
security measures.
Default Method:
Types of Routing:
o Routing can be classified into three categories:
Static Routing
Default Routing
Dynamic Routing
Static Routing:
o Default Routing is a technique in which a router is configured to send all the packets
to the same hop device, and it doesn't matter whether it belongs to a particular
network or not.
o A Packet is transmitted to the device for which it is configured in default routing.
o Default Routing is used when networks deal with the single exit point.
o It is also useful when the bulk of transmission networks have to transmit the data to
the same hp device.
o When a specific route is mentioned in the routing table, the router will choose the
specific route rather than the default route.
o The default route is chosen only when a specific route is not mentioned in the
routing table.
Dynamic Routing:
Router Architecture:
43. List out Network Layer Protocols. Explain ARP and RARP.
OR
Q. Explain Physical addresses and Logical addresses.
Ans:
ARP:
o ARP stands for Address Resolution Protocol.
o It is used to associate an IP address with the MAC address.
o Each device on the network is recognized by the MAC address imprinted on the
NIC.
o Therefore, we can say that devices need the MAC address for communication on a
local area network.
o MAC address can be changed easily.
MAC address:
o The MAC address is used to identify the actual device.
IP address:
o It is an address used to locate a device on the network.
If the host wants to know the physical address of another host on its network, then it sends
an ARP query packet that includes the IP address and broadcast it over the network.
Every host on the network receives and processes the ARP packet, but only the intended
recipient recognizes the IP address and sends back the physical address.
The host holding the datagram adds the physical address to the cache memory and to the
datagram header, then sends back to the sender.
RARP:
IGMP:
o IGMP stands for Internet Group Message Protocol.
o The IP protocol supports two types of communication:
Unicasting: It is a communication between one sender and one receiver.
Therefore, we can say that it is one-to-one communication.
Multicasting: Sometimes the sender wants to send the same message to a
large number of receivers simultaneously. This process is known as
multicasting which has one-to-many communication.
o The IGMP protocol is used by the hosts and router to support multicasting.
o The IGMP protocol is used by the hosts and router to identify the hosts in a LAN
that are the members of a group.
VERSION:
o Version of the IP protocol (4 bits), which is 4 for IPv4
HLEN:
o IP header length (4 bits), which is the number of 32 bit words in the header.
o The minimum value for this field is 5 and the maximum is 15
Type of service:
o Low Delay, High Throughput, Reliability (8 bits)
Total Length:
o Length of header + Data (16 bits), which has a minimum value 20 bytes and the
maximum is 65,535 bytes
Identification:
o Unique Packet Id for identifying the group of fragments of a single IP datagram (16
bits)
Flags:
o 3 flags of 1 bit each :
reserved bit (must be zero),
do not fragment flag,
more fragments flag (same order)
Fragment Offset:
o Specified in terms of number of 8 bytes, which has the maximum value of 65,528
bytes
Time to live:
o Datagram’s lifetime (8 bits), It prevents the datagram to loop through the network
Protocol:
o Name of the protocol to which the data is to be passed (8 bits)
Header Checksum:
o 16 bits header checksum for checking errors in the datagram header
Source IP address:
o 32 bits IP address of the sender
Destination IP address:
o 32 bits IP address of the receiver
Option:
o Optional information such as source route, record route.
Version:
o This four-bit field specifies the version of the IP, i.e., 6 in this case.
Priority:
o It defines the priority of the packet concerning traffic congestion.
Flow label:
o The reason for designing this protocol is to facilitate with special controlling for a
certain flow of data.
Payload length:
o It defines the total length of the IP datagram excepting the base header.
Next header:
o It’s an eight-bit field describe the header that trails the base header in the datagram.
o The next header is one of the optional extension headers which IP uses or the header
for an upper layer protocol such as UDP or TCP.
Hop limit:
o This eight-bit hop limit field assist with the same functions at the TTL field in IPv4.
Source address:
o It is a 16 bytes internet address identifies the source of the datagram.
Destination address:
o This is 16-byte internet address that generally describes the final destination of the
datagram.
Class A starts with 0 followed by 7 bits of network ID and 24 bits of host ID.
Class B starts with 10 followed by 14 bits of network ID and 16 bits of host ID.
Class C starts with 110 followed by 21 bits of network ID and 8 bits of host ID.
Class D starts with 1110 followed by 28 bits. Class D is used only for multicast addressing
by which a group of hosts form a multicast group and each group requires a multicast
address.
Class E starts with 1111 followed by 28 bits. Class E is reserved for network experiments
only.
IPv6 address is 128 bits in length and is written as eight groups of four hexadecimal
digits.
Each group is separated from the others by colons (:) as shown in figure.
Hexadecimal characters are not case sensitive, therefore an address can be written
either in uppercase or lowercase, both are equivalent.
o Unicasting is the most commonly used data transmission type on the internet.
o In Unicasting, the data traffic flows from a single source node to a single destination
node on the network.
o It is a 'one-to-one' type of data transmission between the sender and receiver.
o It can be best implemented in computer-to-computer or server-to-server or client-
to-server kind of communications.
o SMTP(Simple Mail Transfer Protocol) protocol can be used for unicasting an email
on the internet.
o Similarly, FTP(File Transfer Protocol) can be used for unicasting a particular file
from one computer to another on the network.
o Some other protocols like HTTP(HyperText Markup Language), Telnet, etc. can
also be used for unicasting on the network.
Any-casting:
53. Explain Routing protocols: Distance vector routing, Link state routing
and Path vector Routing.
OR
Q. Explain Distance vector routing (Bellman ford) Algorithm with
Example.
Q. Explain Link state routing (Dijsktra) Algorithm with Example.
Q. Explain Path vector Routing Algorithm with Example.
Ans:
A Router is a process of selecting path along which the data can be transferred from source
to the destination.
Routing is performed by a special device known as a router.
A Router works at the network layer in the OSI model and internet layer in TCP/IP model
A router is a networking device that forwards the packet based on the information available
in the packet header and forwarding table.
Dynamic routing protocols use metric, cost, and hop count to identify the best path from
the path available for the destination network.
There are mainly 3 different classes of routing protocols:
o Distance vector routing
o Link state routing
o Path vector Routing.
Example: Consider 3-routers X, Y and Z as shown in figure. Each router have their
routing table. Every routing table will contain distance to the destination nodes.
o Consider router X
o Consider router Z
Solution:
o It is the initial table for each speaker node in a system made four ASs.
o Here Node A1 is the speaker node for AS1, B1 for AS2, C1 for AS3 and D1 for
AS4, Node A1 creates an initial table that shows A1 to A5 and these are located in
AS1, it can be reached through it.
o A speaker in an autonomous system shares its table with immediate neighbors ,here
Node A1 share its table with nodes B1 and C1 , Node C1 share its table with nodes
A1,B1 and D1 , Node B1 share its table with nodes A1 and C1 , Node D1 share its
table with node C1
o If router A1 receives a packet for nodes A3 , it knows that the path is in AS1,but if
it receives a packet for D1,it knows that the packet should go from AS1,to AS2 and
then to AS3 ,then the routing table shows that path completely on the other hand if
the node D1 in AS4 receives a packet for node A2,it knows it should go through
AS4,AS3,and AS1.
FUNCTIONS:
o PREVENTION OF LOOP
The creation of loop can be avoided in path vector routing .
A router receives a message it checks to see if its autonomous system is in
the path list to the destination if it is looping is involved and the message is
ignored
o POLICY ROUTING
When a router receives a messages it can check the path, if one of the
autonomous system listed in the path against its policy, it can ignore its path
and destination it does not update its routing table with this path or it does
not send the messages to its neighbors.
o OPTIMUM PATH
A path to a destination that is the best for the organization that runs the
autonomous system
55. Explain Functions of Data Link Layer and List out Services of Data Link
Layer.
Ans:
Data link layer:
o In the OSI model, the data link layer is a 4th layer from the top and 2nd layer
from the bottom.
o The data link layer is responsible for moving frames from one hop (node) to the
next.
o Groups of bits its called Frame.
o Single-Bit Error:
The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.
In the above figure, the message which is sent is corrupted as single-bit, i.e.,
0 bit is changed to 1.
Single-Bit Error does not appear more likely in Serial Data
Transmission.
o Burst Error:
The two or more bits are changed from 0 to 1 or from 1 to 0 is known as
Burst Error.
The Burst Error is determined from the first corrupted bit to the last
corrupted bit.
The duration of noise in Burst Error is more than the duration of noise in
Single-Bit.
Burst Errors are most likely to occurr in Serial Data Transmission.
The number of affected bits depends on the duration of the noise and data
rate.
o In this technique, a redundant bit is also known as a parity bit which is appended at
the end of the data unit so that the number of 1s becomes even.
o Therefore, the total number of transmitted bits would be 9 bits.
o If the number of 1s bits is odd, then parity bit 1 is appended and if the number of 1s
bits is even, then parity bit 0 is appended at the end of the data unit.
o At the receiving end, the parity bit is calculated from the received data bits and
compared with the received parity bit.
o This technique generates the total number of 1s even, so it is known as even-parity
checking.
o Drawbacks Of Single Parity Checking
It can only detect single-bit errors which are very rare.
If two bits are interchanged, then it cannot detect the errors.
o Checksum Checker:
A Checksum is verified at the receiving side.
The receiver subdivides the incoming data into equal segments of n bits
each, and all these segments are added together, and then this sum is
complemented.
If the complement of the sum is zero, then the data is accepted otherwise
data is rejected.
o CRC Checker:
o Flag Field:
In HDLC, each frame starts and ends with the flag field in the configuration
and is defined by an 8-bit octet sequence 01111110 in the flag field.
o Address Field:
It encapsulates the receiver's address in the field.
For example, if the frame is sent from the primary station, it contains the
secondary station’s address and vice versa.
o Control Field:
This field contains the flow and error control information in byte format.
o Payload/Information Field:
It carries information from the network layer, and the data size may vary
depending on the network.
o FCS Field:
This field stands for Frame Check Sequence and acts as an error detection
field in the HDLC protocol, which includes a 16-bit CRC check bit.
o I-Frame:
The supervisory frame or S-frames are used for error and data flow control
and do not contain the information field in the frame format.
The control field is 1 and 0 for the first two bits.
o U-Frame:
o The un-numbered frame or U-frames are used for system management and
exchanging control information between the connected network devices.
ALOHA :
o ALO means “Share”.
o HA means “Essence of life”
It is designed for wireless LAN (Local Area Network) but can also be used in a shared
medium to transmit data.
Using this method, any station can transmit data across a network simultaneously when a
data frameset is available for transmission.
Aloha Rules
o Any station can transmit data to a channel at any time.
o It does not require any carrier sensing.
o Collision and data frames may be lost during the transmission of data through
multiple stations.
o Acknowledgment of the frames exists in Aloha. Hence, there is no collision
detection.
o It requires retransmission of data after some random amount of time.
Pure Aloha:
o Whenever data is available for sending over a channel at stations, we use Pure
Aloha.
o In pure Aloha, when each station transmits data to a channel without checking
whether the channel is idle or not, the chances of collision may occur, and the data
frame can be lost.
o When any station transmits the data frame to a channel, the pure Aloha waits for
the receiver's acknowledgment.
o If it does not acknowledge the receiver end within the specified time, the station
waits for a random amount of time, called the backoff time (Tb). And the station
may assume the frame has been lost or destroyed. Therefore, it retransmits the frame
until all the data are successfully transmitted to the receiver.
The total vulnerable time of pure Aloha is 2 * Tfr.
Maximum throughput occurs when G = 1/ 2 that is 18.4%.
Successful transmission of data frame is S = G * e ^ - 2 G.
o As we can see in the figure above, there are four stations for accessing a shared
channel and transmitting data frames. Some frames collide because most stations
send their frames at the same time.
o Only two frames, frame 1.1 and frame 2.2, are successfully transmitted to the
receiver end.
Slotted Aloha:
o The slotted Aloha is designed to overcome the pure Aloha's efficiency because pure
Aloha has a very high possibility of frame hitting.
o In slotted Aloha, the shared channel is divided into a fixed time interval called slots.
o So that, if a station wants to send a frame to a shared channel, the frame can only
be sent at the beginning of the slot, and only one frame is allowed to be sent to each
slot.
o And if the stations are unable to send data to the beginning of the slot, the station
will have to wait until the beginning of the slot for the next time.
o However, the possibility of a collision remains when trying to send a frame at the
beginning of two or more station time slot.
Maximum throughput occurs in the slotted Aloha when G = 1 that is 37%.
The probability of successfully transmitting the data frame in the slotted
Aloha is S = G * e ^ - 2 G.
The total vulnerable time required in slotted Aloha is Tfr.
CSMA:
It is a carrier sense multiple access based on media access protocol to sense the traffic
on a channel (idle or busy) before transmitting the data.
It means that if the channel is idle, the station can send data to the channel.
Otherwise, it must wait until the channel becomes idle.
Hence, it reduces the chances of a collision on a transmission medium.
o Non-Persistent:
It is the access mode of CSMA that defines before transmitting the data,
each node must sense the channel, and if the channel is inactive, it
immediately sends the data.
Otherwise, the station must wait for a random time (not continuously),
and when the channel is found to be idle, it transmits the frames.
CSMA/CD:
o CS: It stands for Carrier Sensing. It implies that before sending data, a station first
senses the carrier. If the carrier is found free, then the station transmits data else it
refrains.
o MA: Stands for Multiple Access i.e. if there’s a channel, then there are many
stations that are trying to access it.
o CD: Stands for Collision Detection. It also guides to proceed in case of packet data
collision.
TDMA
CDMA
For Ethernet, the protocol data unit is Frame since we mainly deal with DLL.
In order to handle collision, the Access control mechanism used in Ethernet is CSMA/CD.
Manchester Encoding Technique is used in Ethernet.
Since we are talking about IEEE 802.3 standard Ethernet, therefore, 0 is expressed by a
high-to-low transition, a 1 by the low-to-high transition.
In both Manchester Encoding and Differential Manchester, the Encoding Baud rate is
double of bit rate.
Ethernet Frame Format:
63. Explain Token bus (IEEE standards 802.4) and Token ring (IEEE
standards 802.5).
Ans:
Token bus (IEEE standards 802.4):
Token Bus (IEEE 802.4) is a popular standard for token passing LANs.
In a token bus LAN, the physical media is a bus or a tree, and a logical ring is created using
a coaxial cable.
The token is passed from one user to another in a sequence (clockwise or anticlockwise).
Each station knows the address of the station to its “left” and “right” as per the sequence in
the logical ring.
A station can only transmit data when it has the token.
The working of a token bus is somewhat similar to Token Ring.
The Token Bus (IEEE 802.4) is a standard for deploying token rings in LANs over a virtual
ring.
The physical medium uses coaxial cables and has a bus or tree architecture.
The nodes/stations form a virtual ring, and the token is transmitted from one node to the
next in a sequence along the virtual ring.
Each node knows the address of the station before it and the station after it. When a station
has the token, it can only broadcast data.
The token bus works in a similar way as the Token Ring.
Token ring (IEEE 802.5) is a communication protocol in a local area network (LAN) where
all stations are connected in a ring topology and pass one or more tokens for channel
acquisition.
A token is a special frame of 3 bytes that circulates along the ring of stations.
A station can send data frames only if it holds a token.
The tokens are released on successful receipt of the data frame.
If a station has a frame to transmit when it receives a token, it sends the frame and then
passes the token to the next station; otherwise it simply passes the token to the next station.
Passing the token means receiving the token from the preceding station and transmitting to
the successor station.
The data flow is unidirectional in the direction of the token passing.
In order that tokens are not circulated infinitely, they are removed from the network once
their purpose is completed.
64. Write a short note: FDDI and DQDB (IEEE standards 802.6).
Ans:
FDDI.
IEEE 802.6(DQDB):
A virtual local area network (VLAN) is a virtualized connection that connects multiple
devices and network nodes from different LANs into one logical network.
VLAN is a logical system grouping in the same area of the broadcast.
VLANs are configured on switches by putting interfaces in one and many interfaces on
another broadcast domain.
Types of VLANs:
Protocol VLAN:
o Here, the traffic is handled based on the protocol used.
o A switch or bridge segregates, forwards or discards frames the come to it based
upon the traffics protocol.
Bridge: