CN Answers
CN Answers
Resource sharing: All the resources such as printers, modems, scanners and fax machines etc
can be shared by all the system in a computer network.
Better connectivity and communications: A computer network allows all the user or
computers at a different location to communicate easily, widely used example is email, video
conference etc.
Disadvantages of Computer Network
Lack of data security and privacy due to the huge number of the user accessing the internet
from every corner of the earth, handling data is a challenging task and data can be stolen which
violate the privacy of the user.
Presence of computer viruses and the malware: A virus can easily spread through an
interconnected workstation or over the internet which can damage or steal the data from the
computer system in a computer network.
Lack of Independence: In most cases, the client is dependent on the centralized server and
client user lack any freedom whatsoever. the centralized server can make hinder in the decision
making of the user system.
Need an efficient handler: As a computer network consisting of many devices and software,
so to handle the smooth functioning of the transmission of information, it requires high
technical skills and knows- how its administration and its operations.
OSI TCP/IP
OSI represents Open System Interconnection. TCP/IP model represents the Transmission Control
Protocol / Internet Protocol.
OSI is a generic, protocol independent standard. It is TCP/IP model depends on standard protocols about which
acting as an interaction gateway between the network the computer network has created. It is a connection
and the final-user. protocol that assigns the network of hosts over the
internet.
The OSI model was developed first, and then protocols The protocols were created first and then built the TCP/IP
were created to fit the network architecture’s needs. model.
The OSI model represents defines administration, It does not mention the services, interfaces, and protocols.
interfaces and conventions. It describes clearly which
layer provides services.
The protocols of the OSI model are better unseen and The TCP/IP model protocols are not hidden, and we
can be returned with another appropriate protocol cannot fit a new protocol stack in it.
quickly.
It provides both connection and connectionless oriented It provides connectionless transmission in the network
transmission in the network layer; however, only layer and supports connecting and connectionless-
connection-oriented transmission in the transport layer. oriented transmission in the transport layer.
The smallest size of the OSI header is 5 bytes. The smallest size of the TCP/IP header is 20 bytes.
Protocols are unknown in the OSI model and are In TCP/IP, returning protocol is not difficult.
returned while the technology modifies.
Service generally includes set of various primitives. A primitive simply means Operations.
A Service is specified by set of primitives that are available and given to user or other various
entities to access the service. All these primitives simply tell the service to perform some action or to
report on action that is taken by peer entity.
Primitives are called calling functions between the layers that are used to manage communication
among the adjacent protocol layers i.e., among the same communication node.
Classification of Service Primitives :
Primitive Meaning
Request This primitive is transferred or sent to Layer N by Layer (N+1) to just request
for service
Confirm This primitive is returned by the Nth layer to the requesting (N+1)st layer to
simply acknowledge or complete action that is previously invoked by request
primitive.
https://www.geeksforgeeks.org/service-primitives/
6.Explain about OSI model and illustrate the functions, protocols and services of
each layer
OSI Model
o OSI stands for Open System Interconnection is a reference model that describes how information
from a software application in one computer moves through a physical medium to the software
application in another computer.
o OSI consists of seven layers, and each layer performs a particular network function.
o OSI model was developed by the International Organization for Standardization (ISO) in 1984, and
it is now considered as an architectural model for the inter-computer communications.
o OSI model divides the whole task into seven smaller and manageable tasks. Each layer is assigned
a particular task.
o Each layer is self-contained, so that task assigned to each layer can be performed independently.
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1) Physical layer
o The main functionality of the physical layer is to transmit the individual bits from one node to
another node.
o It is the lowest layer of the OSI model.
o It establishes, maintains and deactivates the physical connection.
o It specifies the mechanical, electrical and procedural network interface specifications.
o Line Configuration: It defines the way how two or more devices can be connected physically.
o Data Transmission: It defines the transmission mode whether it is simplex, half-duplex or full-
duplex mode between the two devices on the network.
o Topology: It defines the way how network devices are arranged.
o Signals: It determines the type of the signal used for transmitting the information.
2) Data-Link Layer
o This layer is responsible for the error-free transfer of data frames.
o It defines the format of the data on the network.
o It provides a reliable and efficient communication between two or more devices.
o It is mainly responsible for the unique identification of each device that resides on a local
network.
o It contains two sub-layers:
o Logical Link Control Layer
o Media Access Control Layer
o Framing: The data link layer translates the physical's raw bit stream into packets known as
Frames. The Data link layer adds the header and trailer to the frame. .
o Physical Addressing: The Data link layer adds a header to the frame that contains a destination
address. The frame is transmitted to the destination address mentioned in the header.
o Flow Control: Flow control is the main functionality of the Data-link layer. It is the technique
through which the constant data rate is maintained on both the sides so that no data get corrupted. It
ensures that the transmitting station such as a server with higher processing speed does not exceed
the receiving station, with lower processing speed.
o Error Control: Error control is achieved by adding a calculated value CRC (Cyclic Redundancy
Check) that is placed to the Data link layer's trailer which is added to the message frame before it is
sent to the physical layer. If any error seems to occurr, then the receiver sends the acknowledgment
for the retransmission of the corrupted frames.
o Access Control: When two or more devices are connected to the same communication channel,
then the data link layer protocols are used to determine which device has control over the link at a
given time.
3) Network Layer
o It is a layer 3 that manages device addressing, tracks the location of devices on the network.
o It determines the best path to move data from source to the destination based on the network
conditions, the priority of service, and other factors.
o The Data link layer is responsible for routing and forwarding the packets.
o The protocols used to route the network traffic are known as Network layer protocols. Examples of
protocols are IPv4 and Ipv6.
4) Transport Layer
o The Transport layer is a Layer 4 ensures that messages are transmitted in the order in which they
are sent and there is no duplication of data.
o The main responsibility of the transport layer is to transfer the data completely.
o It receives the data from the upper layer and converts them into smaller units known as segments.
o Service-point addressing: Computers run several programs simultaneously due to this reason, the
transmission of data from source to the destination not only from one computer to another
computer but also from one process to another process.
o Segmentation and reassembly: When the transport layer receives the message from the upper
layer, it divides the message into multiple segments, and each segment is assigned with a sequence
number that uniquely identifies each segment. When the message has arrived at the destination,
then the transport layer reassembles the message based on their sequence numbers.
o Connection control: Transport layer provides two services Connection-oriented service and
connectionless service. A connectionless service treats each segment as an individual packet, and
they all travel in different routes to reach the destination. A connection-oriented service makes a
connection with the transport layer at the destination machine before delivering the packets.
o Flow control: The transport layer also responsible for flow control but it is performed end-to-end
rather than across a single link.
o Error control: The transport layer is also responsible for Error control. Error control is performed
end-to-end rather than across the single link. The sender transport layer ensures that message reach
at the destination without any error.
5) Session Layer
o It is a layer 3 in the OSI model.
o The Session layer is used to establish, maintain and synchronizes the interaction between
communicating devices.
o Dialog control: Session layer acts as a dialog controller that creates a dialog between two
processes or we can say that it allows the communication between two processes which can be
either half-duplex or full-duplex.
o Synchronization: Session layer adds some checkpoints when transmitting the data in a sequence.
If some error occurs in the middle of the transmission of data, then the transmission will take place
again from the checkpoint.
6) Presentation Layer
o A Presentation layer is mainly concerned with the syntax and semantics of the information
exchanged between the two systems.
o It acts as a data translator for a network.
o The Presentation layer is also known as the syntax layer.
7) Application Layer
o An application layer serves as a window for users and application processes to access network
service.
o It handles issues such as network transparency, resource allocation, etc.
o An application layer is not an application, but it performs the application layer functions.
o This layer provides the network services to the end-users.
o File transfer, access, and management (FTAM): An application layer allows a user to access the
files in a remote computer, to retrieve the files from a computer and to manage the files in a remote
computer.
o Mail services: An application layer provides the facility for email forwarding and storage.
o Directory services: An application provides the distributed database sources and is used to provide
that global information about various objects.
7.Explain about TCP/IP model and illustrate the functions, protocols and
services of
each layer?
The OSI Model we just looked at is just a reference/logical model. It was designed to describe the
functions of the communication system by dividing the communication procedure into smaller and
simpler components. But when we talk about the TCP/IP model, it was designed and developed by
Department of Defense (DoD) in 1960s and is based on standard protocols. It stands for
Transmission Control Protocol/Internet Protocol. The TCP/IP model is a concise version of the OSI
model. It contains four layers, unlike seven layers in the OSI model. The layers are:
1. Process/Application Layer
2. Host-to-Host/Transport Layer
3. Internet Layer
4. Network Access/Link Layer
TCP/IP
TCP refers to Transmission Control Protocol.
TCP/IP has 4 layers.
TCP/IP uses both session and presentation layer in the application layer itself.
This layer corresponds to the combination of Data Link Layer and Physical Layer of the OSI model.
It looks out for hardware addressing and the protocols present in this layer allows for the physical
transmission of data.
2. Internet Layer –
This layer parallels the functions of OSI’s Network layer. It defines the protocols which are
responsible for logical transmission of data over the entire network. The main protocols residing at
this layer are :
1. IP – stands for Internet Protocol and it is responsible for delivering packets from the source host
to the destination host by looking at the IP addresses in the packet headers. IP has 2 versions:
IPv4 and IPv6. IPv4 is the one that most of the websites are using currently. But IPv6 is growing
as the number of IPv4 addresses are limited in number when compared to the number of users.
2. ICMP – stands for Internet Control Message Protocol. It is encapsulated within IP datagrams and
is responsible for providing hosts with information about network problems.
3. ARP – stands for Address Resolution Protocol. Its job is to find the hardware address of a host
from a known IP address. ARP has several types: Reverse ARP, Proxy ARP, Gratuitous ARP and
Inverse ARP.
3. Host-to-Host Layer –
This layer is analogous to the transport layer of the OSI model. It is responsible for end-to-end
communication and error-free delivery of data. It shields the upper-layer applications from the
complexities of data. The two main protocols present in this layer are :
1. Transmission Control Protocol (TCP) – It is known to provide reliable and error-free
communication between end systems. It performs sequencing and segmentation of data. It also
has acknowledgment feature and controls the flow of the data through flow control mechanism. It
is a very effective protocol but has a lot of overhead due to such features. Increased overhead
leads to increased cost.
2. User Datagram Protocol (UDP) – On the other hand does not provide any such features. It is
the go-to protocol if your application does not require reliable transport as it is very cost-
effective. Unlike TCP, which is connection-oriented protocol, UDP is connectionless.
4. Application Layer –
This layer performs the functions of top three layers of the OSI model: Application, Presentation and
Session Layer. It is responsible for node-to-node communication and controls user-interface
specifications. Some of the protocols present in this layer are: HTTP, HTTPS, FTP, TFTP, Telnet,
SSH, SMTP, SNMP, NTP, DNS, DHCP, NFS, X Window, LPD. Have a look at Protocols in
Application Layer for some information about these protocols. Protocols other than those present in
the linked article are :
1. HTTP and HTTPS – HTTP stands for Hypertext transfer protocol. It is used by the World Wide
Web to manage communications between web browsers and servers. HTTPS stands for HTTP-
Secure. It is a combination of HTTP with SSL(Secure Socket Layer).
2. SSH – SSH stands for Secure Shell. It is a terminal emulations software similar to Telnet. The
reason SSH is more preferred is because of its ability to maintain the encrypted connection. It
sets up a secure session over a TCP/IP connection.
3. NTP – NTP stands for Network Time Protocol. It is used to synchronize the clocks on our
computer to one standard time source. It is very useful in situations like bank transactions.
Assume the following situation without the presence of NTP.
Bus network topology -- Also known as backbone network topology, this configuration connects
all devices to a main cable via drop lines. The advantages of bus network topology lie in its
simplicity, as there is less cable required than in alternative topologies, which makes for easy
installation.
Mesh network topology -- A dedicated point-to-point link connects each device on the network to
another device on the network, only carrying data between two devices.
Ring network topology -- Two dedicated point-to-point links connect a device to the two devices
located on either side of it, creating a ring of devices through which data is forwarded via repeaters
until it reaches the target device.
Star network topology -- The most common network topology, star topology connects each device
in the network to a central hub. Devices can only communicate with each other indirectly through
the central hub.
Hybrid network topology -- Any combination of two or more topologies is a hybrid topology.
Tree network topology -- This topology consists of a parent-child hierarchy in which star networks
are interconnected via bus networks. Nodes branch out linearly from one root node, and two
connected nodes only share one mutual connection.
UNIT 2
1. Define flow control and error control?
Flow Control :
It is an important function of the Data Link Layer. It refers to a set of procedures that tells the sender
how much data it can transmit before waiting for acknowledgement from the receiver.
Purpose of Flow Control :
Any receiving device has a limited speed at which it can process incoming data and also a limited
amount of memory to store incoming data. If the source is sending the data at a faster rate than the
capacity of the receiver, there is a possibility of the receiver being swamped. The receiver will keep
losing some of the frames simply because they are arriving too quickly and the buffer is also getting
filled up.
This will generate waste frames on the network. Therefore, the receiving device must have some
mechanism to inform the sender to send fewer frames or stop transmission temporarily. In this way,
flow control will control the rate of frame transmission to a value that can be handled by the
receiver.
Example – Stop & Wait Protocol
2. Error Control :
The error control function of data link layer detects the errors in transmitted frames and re-transmit
all the erroneous frames.
Purpose of Error Control :
The function of the error control function of the data link layer helps in dealing with data frames that
are damaged in transit, data frames lost in transit, and the acknowledgement frames that are lost in
transmission. The method used for error control is called Automatic Repeat Request which is used
for the noisy channel. Example – Stop & Wait ARQ and Sliding Window ARQ
2. Discuss about checksum in brief. Also find the checksum at sender and
receiver for the sequence 10110011 10101011 01011010 11010101?
3. Differentiate between the backward error control and forward error control?
FEC
Forward Error Correction (FEC) is a type of error correction that involves encoding a message in a redundant way, which allows
the receiver to reconstruct lost bits without the need for retransmission.
FEC works by adding “check bits” to the outgoing data stream. Adding more check bits reduces the amount of
available bandwidth by increasing the overall block size of the outgoing data, but also enables the receiver to correct for more
errors without receiving any additional transmitted data.
This dynamic makes FEC ideal when bandwidth is plentiful, but retransmission is costly or impossible.
The “check bits,” or redundant bits, that the sender adds to the data stream are coded into the data in a very specific way, which
allows for efficient error correction by the receiving device.
BEC
Backward Error Correction, also known as an “Automatic Repeat Request” is an error correction technique in which a receiving
device sends a request to the source device to re-send information. Backward Error Correction is used in situations where some
of the transmitted data has been lost or corrupted during transit and the transmitting device must resend the information in order
for the receiving device to understand the transmission. Backward Error Correction is the opposite of “Forward Error
Correction”, in which a transmitting device simply sends redundant information to make up for any potential errors
Backward Error Correction is dependent on a number of protocols and algorithms, such as parity bits, cyclic redundancy checks,
and longitudinal redundancy checks, but relies on the same procedure. As usual, a transmitting device will send data to a
receiving device.
In this error detection technique, a redundant bit called parity bit is appended to every data unit so
that total number of 1's in the unit (including parity bit) becomes even. The system now transmits
entire extended unit across the network link. At the receiver, all eight received bits are checked
through even parity checking function. If it counts even 1's data unit passes. If it counts odd
number of 1's, it means error has been introduced in the data somewhere. Hence receiver rejects
the whole data unit. Similar way odd parity VRC can also be implemented. In this method, total
number of 1's in should be odd before transmission.
In this error detection method, a block of bits are organized in a table (of rows and columns). For
example, instead of sending block of 32 bits, first it is organized into four rows and eight columns.
Then parity bits for each column is calculated and new row of eight parity bits is formed. These
eight parity bits are appended to original data before transmission.
5. What is piggybacking?
(Piggybacking) –
A preferable solution would be to use each channel to transmit the frame (front and back) both ways,
with both channels having the same capacity. Assume that A and B are users. Then the data frames
from A to B are interconnected with the acknowledgement from A to B. and can be identified as a
data frame or acknowledgement by checking the sort field in the header of the received frame.
One more improvement can be made. When a data frame arrives, the receiver waits does not send
the control frame (acknowledgement) back immediately. The receiver waits until its network layer
moves to the next data packet.
Definition of Piggybacking :
This technique in which the outgoing acknowledgement is delayed temporarily is
called piggybacking.
Advantages of piggybacking :
1. The major advantage of piggybacking is the better use of available channel bandwidth. This
happens because an acknowledgement frame needs not to be sent separately.
2. Usage cost reduction
3. Improves latency of data transfer
Disadvantages of piggybacking :
1. The disadvantage of piggybacking is the additional complexity.
2. If the data link layer waits long before transmitting the acknowledgement (block the ACK for
some time), the frame will rebroadcast.
Note – Point-to-Point Protocol (PPP) is a byte-oriented protocol. Bit stuffing – Mostly flag is a
special 8-bit pattern “01111110” used to define the beginning and the end of the frame. Problem
with the flag is the same as that was in case of byte stuffing. So, in this protocol what we do is, if we
encounter 0 and five consecutive 1 bits, an extra 0 is added after these bits. This extra stuffed bit is
removed from the data by the receiver. The extra bit is added after one 0 followed by five 1 bits
regardless of the value of the next bit. Also, as the sender side always knows which sequence is data
and which is flag it will only add this extra bit in the data sequence, not in the flag sequence.
Example:
Note – High-Level Data Link Control(HDLC) is a bit-oriented protocol.
Character Count
Starting and ending character with character filling
Starting and ending flags with little fillings.
Flow Control
Flow control is done to stop the data flow at the receiver's end. The transmitter will transfer the frames very
quickly to the receiver. However, the receiver will not accept them as quickly as the sender sends because
the sender runs on a lightly loaded machine while the receiver runs on a heavily loaded machine.
It doesn't matter if the transmission is error-free at some point. The receiver will not be able to control the
frames as they will arrive.
For stopping the transmission, a mechanism is there which requests the transmitter to block the incorrect
messages.
Error Control
It is done so that there is no copying of the frames for the safe delivery of the frames at the destination. In
addition, Positive and negative acceptance is sent about the incoming frames.
Therefore, if the sender gets positive acceptance, that means the frame appears safely, while negative
appearance means that something is wrong with the frame and the frame will be retransferred.
The timer is put at the receiver's and sender's end. Besides, the sequence number is given to the outgoing
transmission. So that receiver will easily identify that it is a retransmitted frame. It is one of the main parts
of the data link layer responsibilities.
8.Explain about CRC and Generate the CRC code for message
1101010101.Given
generator polynomial g(x)=x 4 +x 2 +1?
Elementary Data Link protocols are classified into three categories, as given below −
Protocol 1 − Unrestricted simplex protocol
Protocol 2 − Simplex stop and wait protocol
Protocol 3 − Simplex protocol for noisy channels.
Let us discuss each protocol one by one.