Professional Documents
Culture Documents
Computer Networks
Computer Networks
FEATURES:
● It transmits data only in one direction (unidirectional)
● Every device is connected to a single cable
ADVANTAGES:
● Low cost
● Used in small networks.
● Easy to expand by joining two cables together.
DISADVANTAGES:
● Network fails due to cable failure.
● In case of heavy network traffic , the performance of the network decreases.
● Cable has a limited length.
FEATURES:
● A number of repeaters are used and the transmission is unidirectional.
● Data is transferred in a sequential manner that is bit by bit
ADVANTAGES:
● Easy to install and reconfigure.
● Offers equal access to all the computers of the networks
● Faster error checking and acknowledgment.
DISADVANTAGES:
● Break in a single ring can risk the breaking of the entire network
● Modern day high-speed LANs made this topology less popular.
● It is very difficult to troubleshoot the ring network.
3) STAR TOPOLOGY: In this type of topology all the computers are connected to a single hub
through a cable.
This hub is the central node and all other nodes are connected to the central node.
FEATURES:
● Every node has its own dedicated connection to the hub.
● Acts as a repeater for data flow.
● Can be used with twisted pair, Optical Fibre or coaxial cable
ADVANTAGES:
● Only those nodes are affected, that has failed. Other nodes still work.
● Fast performance with few nodes and very low network traffic.
● In Star topology, addition, deletion, and moving of the devices are easy.
DISADVANTAGES:
● High Cost and Maintenance
● If the hub fails then the whole network is stopped because all the nodes depend on
the hub.
● Performance is based on the hub, that is it depends on its capacity.
FEATURES:
● Fully connected.
● Robust.
● Not flexible.
ADVANTAGES:
● Each connection can carry its own data load.
● Fault is diagnosed easily.
● Provides security and privacy.
DISADVANTAGES:
● Difficult Installation
● High Cabling cost
● Bulk wiring is required.
● High power consumption and High maintenance.
5) TREE TOPOLOGY: It has a root node and all other nodes are connected to it forming a
hierarchy. It is also called hierarchical topology. It should at least have three levels to the
hierarchy.
FEATURES:
● Ideal if workstations are located in groups.
● Used in Wide Area Network.
● Every system is fully connected .
● It Is Robust .
ADVANTAGES:
● Expansion of nodes is possible and easy.
● Easily managed and maintained.
● Error detection is easily done.
DISADVANTAGES:
● Costly.
● Node maintenance is difficult.
● Central hub fails, network fails
6) HYBRID TOPOLOGY: It is two different types of topologies which are a mixture of two or
more topologies.
FEATURES:
● It is a combination of two or more topologies
● Inherits the advantages and disadvantages of the topologies included
ADVANTAGES:
● Effective.
● Scalable as size can be increased easily.
● Flexible.
DISADVANTAGES:
● Complex in design.
● Needs high maintenance.
2) What is bit and byte stuffing? Explain with example.
● When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it
automatically de-stuffs the 0 bit.
● Just as byte stuffing is completely transparent to the network layer in both
computers, so is bit stuffing.
● If the user data contains the flag pattern, 01111110, this flag is transmitted as
011111010 but stored in the receiver's memory as 01111110.
● Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a
0 in the data so that the receiver does not mistake the pattern 0111110 for a flag.
3) What is the difference between error detection and correction? Explain CRC code
generation with example
4) Draw the OSI reference model. Explain the functionality of each layer in brief.
OSI (Open System Interconnection) model is the reference model designed to divide the
entire communication operation into multiple processes. This model divides basic
communication functions into seven different layers
When the data is being transmitted it goes from bottom to top in the OSI layer architecture.
Each layer follows its own function:
1. Physical Layer − Its function is to transmit individual bits from one node to another
over a physical medium.
● This layer manages the synchronisation of bits.
● Line configuration
● It is also called as Physical topology
● Transmission mode
2. Data Link Layer − It is responsible for the reliable transfer of data frames from one
node to another connected by the physical layer.
● Physical addressing
● Flow control
● Error control
● Access control
3. Network Layer − It manages the delivery of individual data packets from source to
destination through appropriate addressing and routing.
● Logical addressing
● Routing
● Packets
● Congestion control
4. Transport Layer −It is responsible for delivery of the entire message from the source
host to destination host.
● Point to point service
● Segmentation and reassembling
● Connection control
● Flow control
5. Session Layer − It establishes sessions between users and offers services like dialog
control and synchronization.
● Dialog control
● Synchronisation
Packets follow same route Packets does not follow same route
Ex:- TCP (Transmission Control Protocol) Ex:- UDP (User Datagram protocol)
2) Hub - A hub is basically a multiport repeater. A hub connects multiple wires coming from
different branches, for example, the connector in star topology which connects different
stations
3) Bridge - A bridge operates at the data link layer. A bridge is a repeater, which add on the
functionality of filtering content by reading the MAC addresses of source and destination. It
is also used for interconnecting two LANs working on the same protocol.
4) Switch - A switch is a multiport bridge with a buffer and a design that can boost its
efficiency (a large number of ports imply less traffic) and performance and perform error
checking . A switch is a data link layer device
5) Router - A router is a device like a switch that routes data packets based on their IP
addresses. The router is mainly a Network Layer device.
Go Back N
● In Go-Back-N ARQ, the N is the sender window size. Suppose if we say Go-Back-4, the
sender window size is 4. It means it can send 4 frames simultaneously before expecting
any acknowledgement from the receiver.
● Go-Back-N ARQ uses the concept of protocol pipelining, i.e. the sender can send multiple
frames before receiving the acknowledgement for the first frame.
● There is a finite number of frames, and the frames are numbered sequentially.
● The number of frames that can be sent depends on the sender's window size.
● If the acknowledgement of a frame is not received within a certain period of time, all the
frames present in the current window will be transmitted.
● The sending window size determines the sequence number of the outbound frames.
It is the simplest technique for detecting and correcting errors. The MSB of an 8-bits word is
used as the parity bit and the remaining 7 bits are used as data or message bits. The parity of
8-bits transmitted word can be either even parity or odd parity.
Even parity -- Even parity means the number of 1's in the given word including the parity bit
should be even (2,4,6,....).
Odd parity -- Odd parity means the number of 1's in the given word including the parity bit
should be odd (1,3,5,....).
9) What are the issues of stop and wait protocol? How Selective Repeat Protocol resolves
issues of stop and wait protocol?
A) Problems associated with Stop and Wait protocol-
● Problems due to lost data:
Suppose the sender sends the data and this data is lost.
→ The sender waits for the acknowledgement for an infinite amount of time. As
the data is lost, the receiver has not received any packet from the sender. So, it
will not send the acknowledgement to the sender. The receiver waits for an
infinite time for the data pkt.
● Problems due to lost acknowledgement:
In this case, the sender has sent the data to the receiver, and the receiver has
sent the acknowledgement, but here the acknowledgement is lost due to some
problems in the network.
● Problems due to the delayed Acknowledgement/Data:
After a timeout on the sender side, a delayed acknowledgement might be
wrongly considered as the acknowledgement of some other data packet.
II. Coaxial Cable - The name of the cable is coaxial as it contains two conductors parallel
to each other.It has a higher frequency as compared to Twisted pair cable.
It prevents signal interference and crosstalk. Coaxial cable is also known as coax.
Made up of copper.
III. Fiber Optic Cable Fibre optic cable is a cable that uses electrical signals for
communication. They are used to send the data by pulses of light. Fibre optics
provide faster data transmission than copper wires.
III. Infrared waves - Infrared waves are used for very short distance communication.
Frequency Range: 300GHz – 400THz. It is used in TV remotes, wireless mouse,
keyboard, printer, etc.
In the case of the multiple-frame transmission, the ending flag of the one frame acts as the
beginning flag of the next frame.
TCP/IP OSI
Transport layer in TCP/IP does not provide In the OSI model, the transport layer
assurance delivery of packets. provides assurance delivery of packets.
13) Compute CRC for a data sequence 10110111 for which the generator is 110011.
A)
14) What are the reasons for using layered protocols in networks?
A) The reasons for using layered protocols are explained below : -
1. Design:
In a layered model each layer is defined separately. Thus, the design problem is
broken up into smaller and manageable pieces. Another advantage is it allows
protocol designers to specialise in one area (or layer).
2. Change:
When changes are made to one layer, it reduces the impact on the other layers. For
example, protocol in one layer can be changed easily without affecting higher or
lower layers. If the model was not layered and consisted of a single layer then any
change affects the entire model.
3. Learning:
The layered approach divided a big more complex task into several smaller tasks
where each small task is performed by one layer. This makes it much easier to learn
and understand the concept of each layer and the model.
4. Communication:
The layered approach is useful for proper organising and handling of communication.
It also provides a standard programming interface between two layers.
5. Standards:
It is the most important reason for using a layered model. A layered model provides a
guideline and framework not a rigid standard to be used by the various vendors when
creating their products.
15) Distinguish pt-to-pt and multi pt. links. Give relevant diagram along with advantages &
disadvantages.
A)
A. Point to Point Topology
Advantages of Point to Point Topology:
1. Highest Bandwidth because there are only two nodes.
2. Very fast compared to other network topologies
3. Easy to handle and maintain
Disadvantages of Point to Point Topology:
1. This topology is only used for small areas where nodes are closely located.
2. In case of a link broken the entire network will become dead.
3. Major Drawback: if any of the nodes stops working, data cannot be transferred across
the network.
16) Explain how data is transmitted and received in the OSI model.
A) Transmission and receiving of data are the processes carried out by these 7 layers:
7. Application Layer: The application layer is used by end-user software such as web
browsers and email clients. It provides protocols that allow software to send &
receive information and present meaningful data to users
Examples - Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), & Domain
Name System (DNS).
6. Presentation Layer: The presentation layer prepares data for the application layer.
It defines how two devices should encode, encrypt, and compress data so it is
received correctly on the other end. The presentation layer takes any data
transmitted by the application layer and prepares it for transmission over the session
layer.
5. Session Layer: The session layer creates communication channels, called sessions,
between devices. It is responsible for opening sessions, ensuring they remain open
and functional while data is being transferred, and closing them when
communication ends. The session layer can also set checkpoints during a data
transfer—if the session is interrupted, devices can resume data transfer from the last
checkpoint.
4. Transport Layer: The transport layer takes data transferred in the session layer and
breaks it into “segments” on the transmitting end. It is responsible for reassembling
the segments on the receiving end, turning it back into data that can be used by the
session layer. The transport layer carries out flow control, sending data at a rate.
3. Network Layer: The network layer has two main functions. One is breaking up
segments into network packets, and reassembling the packets on the receiving end.
The other is routing packets by discovering the best path across a physical network.
The network layer uses network addresses (typically Internet Protocol addresses) to
route packets to a destination node.
2. Data Link Layer: The data link layer establishes and terminates a connection
between two physically-connected nodes on a network. This layer is composed of two
parts—Logical Link Control (LLC), which identifies network protocols, performs error
checking and synchronises frames, and Media Access Control (MAC) which uses MAC
addresses to connect devices and define permissions to transmit and receive data.
1. Physical Layer: The physical layer is responsible for the physical cable or wireless
connection between network nodes. It defines the connector, the electrical cable or
wireless technology connecting the devices, and is responsible for transmission of the
raw data, which is simply a series of 0s and 1s, while taking care of bit rate control.
It is necessary to keep the light reflecting in core instead of being refracted, because we need
it to pass on to destination from source. And when light enters from denser material into less
dense material the cladding changes its angle, it reflects back the light in core. This is the
reason that the core is denser and the outer layer is less dense.
1. Network operating systems are used in heterogeneous computers and are known as
loosely coupled systems. On the other hand, distributed operating systems (DOS) are
tightly connected systems, and are mostly used in homogeneous computers or
multiprocessors.
2. Communication between computers (nodes) in a DOS is achieved through shared
memory or by sending messages. On the other hand, the network operating system
transfers files to interact with other nodes.
3. The operating system installed on the computers in a network operating system can
vary, but it is not the case in a distributed system.
4. The network operating system's primary goal is to give local services to remote users.
In contrast, DOS's goal is to handle the computer hardware resources.
5. The network operating system has a low level of transparency. On the other hand,
the DOS is highly transparent and hides resource usage.
Error Correction codes are used to detect and correct the errors when data is transmitted
from the sender to the receiver.
Error Correction can be handled in two ways:
Backward error correction: Once the error is discovered, the receiver requests the sender to
retransmit the entire data unit.
Forward error correction: In this case, the receiver uses the error-correcting code which
automatically corrects the errors.
Hamming code is a linear code that is useful for error detection up to two immediate bit
errors. It is capable of single-bit errors.
In Hamming code, the source encodes the message by adding redundant bits in the message.
These redundant bits are mostly inserted and generated at certain positions in the message
to accomplish the error detection and correction process.
Example -
Step 1: For checking parity bit P1, use check one and skip one method, which means, starting
from P1 and then skip P2, take D3 then skip P4 then take D5, and then skip D6 and take D7,
this way we will have the following bits,
As we can observe the total number of bits is odd so we will write the value of parity bit as
P1 = 1. This means the error is there.
Step 2: Check for P2 but while checking for P2, we will use the check two and skip two
methods, which will give us the following data bits. But remember since we are checking for
P2, so we have to start our count from P2 (P1 should not be considered).
As we can observe that the number of 1's are even, then we will write the value of P2 = 0.
This means there is no error.
Step 3: Check for P4 but while checking for P4, we will use the check four and skip four
methods, which will give us the following data bits. But remember since we are checking for
P4, so we have started our count from P4(P1 & P2 should not be considered).
As we can observe that the number of 1's is odd, then we will write the value of P4 = 1. This
means the error is there.
So, from the above parity analysis, P1 & P4 are not equal to 0, so we can clearly say that the
received hamming code has errors.
Now we have to determine the decimal value of this error word 101 which is 5 (22 *1 + 21 *
0 + 20 *1 = 5).
We get E = 5, which states that the error is in the fifth data bit. To correct it, just invert the
fifth data bit.
The method #1 reduces bandwidth efficiency by utilizing the entire channel for ACK.
Moreover method #2 introduces delay between successive packet or frame
transmissions. The above mentioned drawbacks are avoided by transmitting ACK
along with the data packet. Hence problems encountered in both the methods can be
avoided.
Advantages of piggybacking :
● Better use of available channel bandwidth. This happens because an
acknowledgement frame needs not to be sent separately.
● Usage cost reduction
● Improves latency of data transfer
Disadvantages of piggybacking :
● Additional complexity.
● If the data link layer waits long before transmitting the acknowledgement (block the
ACK for some time), the frame will be rebroadcast.
23) Explain the simplest protocol for noisy channels.
A)
● Stop – and – Wait protocol for noisy channels is data link layer protocol for
data communications with error control and flow control mechanisms.
● It is popularly known as Stop – and –Wait Automatic Repeat Request (Stop –
and –Wait ARQ) protocol.
● It adds error control facilities to Stop – and – Wait protocol.
● This protocol takes into account the facts that the receiver has a finite
processing speed and that frames may get corrupted while transmission.
● If acknowledgement does not arrive after a certain period of time , the sender
times out and retransmits the original frame
25) Explain framing and design issues in the data link layer.
A) Framing in the data link layer is a point-to-point connection between the sender and
receiver. The framing is the primary function of the data link layer and it provides a way to
transmit data over frames between the connected devices.
- Framing uses frames to send or receive data. The data link layer receives
packets from the network layer and converts them into frames.
It is assumed that both the sender and the receiver are always ready for data processing and
both of them have infinite buffers. The sender simply sends all its data available onto the
channel as soon as they are available in its buffer. The receiver is assumed to process all
incoming data instantly. It does not handle flow control or error control. Since this protocol is
totally unrealistic, it is often called the Utopian Simplex protocol.
The significance of this protocol lies in the fact that it shows the basic structure on which the
usable protocols are built upon.
27) Let the given data bits are 00111001. Compute the hamming code.
28) Explain about checksum.
A) Checksum is an error detection technique based on the concept of redundancy.
Step-01:
At sender side,
Now, all the segments are added and the result is obtained as-
Step-02:
The data along with the checksum value is transmitted to the receiver.
Step-03:
At receiver side,
The received data unit is divided into segments of 8 bits.
All the segments along with the checksum value are added.
Sum of all segments + Checksum value = 00100101 + 11011010 = 11111111
Complemented value = 00000000
Since the result is 0, the receiver assumes no error occurred in the data and therefore
accepts it.
29) Given a 6-bit data pattern 100100 and a divisor of 1101, answer the following.
i. What will be the dividend at the sender end? 100100000 / 100100 + 000
ii. Determine the CRC. 001
iii. What will be the transmitted data sequence? 100100001
iv. What will be the remainder at receiver end (assuming no error) ? 000
UNIT - 2
1) Name and categorise different multiple access protocols.
Multiple access protocols can be broadly classified into three categories - random access
protocols, controlled access protocols and channelization protocols.
Channelization
Channelization is a set of methods by which the available bandwidth is divided among the
different nodes for simultaneous data transfer. The three channelization methods are
1. Frequency division multiple access (FDMA)
2. Time division multiple access (TDMA)
3. Code division multiple access (CDMA)
Throughput - 18.4%
Slotted ALOHA -
● In slotted aloha, successful data transmission occurs only when each slot sends just one
data frame at a time. The chance of a collision is considerably reduced by doing so.
● Here, time is divided into discrete intervals called slots, corresponding to a frame. The
communicating stations agree upon the slot boundaries.
● Sending of Data only at beginning of these slots
● Any station can send only one frame in each slot. Also, the stations cannot transmit at
any time whenever a frame is available. They should wait for the beginning of the next
slot.
● It will stay idle if no data packets are sent in any of the slots.
● It should be noted that if a packet does not get acknowledgement after a collision, it is
deemed lost and is retransmitted in a different slot after back-off time is taken into
account.
Throughput - 36.8%
Advantages:
● Due to carrier sense property 1-persistent CSMA gives better performance
than the ALOHA systems.
Disadvantages:
● The more the Propagation Delay , the worst the performance of protocol
2. Non-Persistent CSMA
● In this scheme, if a station wants to transmit a frame and it finds that the
channel is busy (some other station is transmitting) then it will wait for a fixed
interval of time.
● After this time, it again checks the status of the channel and if the channel is
free it will transmit.
● A station that has a frame to send, senses the channel.
● If the channel is idle, it sends immediately.
● If the channel is busy, it waits a random amount of time and then senses the
channel again.
● In non-persistent CSMA the station does not continuously sense the channel
for the purpose of capturing it when it detects the end of previous
transmission.
Advantages:
● It reduces the chance of collision and leads to better channel utilization,
Disadvantages:
● It reduces the efficiency of the network because the channel remains idle and
it leads to longer delays than 1-persistent CSMA
4) What is CSMA/CA?
A) Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) is a network protocol
for carrier transmission that operates in the Medium Access Control (MAC) layer. In contrast
to CSMA/CD (Carrier Sense Multiple Access/Collision Detection) that deals with collisions
after their occurrence, CSMA/CA prevents collisions prior to their occurrence.
The algorithm of CSMA/CA is:
● When a frame is ready, the transmitting station checks whether the channel is idle or busy.
● If the channel is busy, the station waits until the channel becomes idle.
● If the channel is idle, the station waits for an Inter-frame gap (IFG) amount of time and
then sends the frame.
● After sending the frame, it sets a timer.
●The station then waits for acknowledgement from the receiver. If it receives the
acknowledgement before expiry of timer, it marks a successful transmission.
● Otherwise, it waits for a back-off time period and restarts the algorithm.
Advantages of CSMA/CA
● CSMA/CA prevents collision.
● Due to acknowledgements, data is not lost unnecessarily.
● It avoids wasteful transmission.
● It is very much suited for wireless transmissions.
Disadvantages of CSMA/CA
● The algorithm calls for long waiting times.
● It has high power consumption.
7) Explain Manchester encoding and differential Manchester encoding for bit stream
A)
Advantages of Ethernet
● Relatively low cost
● generally resistant to noise;
● good data transfer quality
● Speed and Reliability
Disadvantages of Ethernet
● intended for smaller, shorter distance networks
● limited mobility , speeds decrease with increased traffic
● use of longer cables can create crosstalk
● doesn't work well with real-time or interactive applications.
9) Differentiate fast Ethernet and gigabit Ethernet.
1. Reservation
In the reservation method, a station needs to make a reservation before sending data. Time
is divided into intervals. In each interval, a reservation frame precedes the data frames sent
in that interval.
If there are N stations in the system, there are exactly N reservation minislots in the
reservation frame. Each minislot belongs to a station. When a station needs to send a data
frame, it makes a reservation in its own minislot. The stations that have made reservations
can send their data frames after the reservation frame.
In the first interval, only stations 1, 3, and 4 have made reservations. In the second interval,
only station 1 has made a reservation.
2. Polling
Polling works with topologies in which one device is designated as a primary station (master)
and the other devices are secondary stations. All data exchanges must be made through the
primary device even when the ultimate destination is a secondary device. The primary device
controls the link; the secondary devices follow its instructions. It is up to the primary device
to determine which device is allowed to use the channel at a given time. The primary device,
therefore, is always the initiator of a session.
3. Token Passing
In the token-passing method, the stations in a network are organised in a logical ring. In
other words, for each station, there is a predecessor and a successor. The predecessor is the
station which is logically before the station in the ring; the successor is the station which is
after the station in the ring. The current station is the one that is accessing the channel now.
The right to this access has been passed from the predecessor to the current station. The
right will be passed to the successor when the current station has no more data to send.
14) What are the functions of LLC & MAC.
A)
Functions of LLC Sublayer:
● The primary function of LLC is to multiplex protocols over the MAC layer while
transmitting and to de-multiplex the protocols while receiving.
● Handles communication between upper and lower layers.
● LLC provides hop-to-hop flow and error control.
● It allows multipoint communication over a computer network.
● Frame Sequence Numbers are assigned by LLC.
● In case of acknowledged services, it tracks acknowledgements
Step-2: The station increments the retransmission counter, c, that denotes the number of
collisions.
Step-3: The station selects a random number of slot times in the range 0 and 2^c – 1. For
example, after the first collision (i.e. c = 1), the station will wait for either 0 or 1 slot times.
After the second collision (i.e. c = 2), the station will wait anything between 0 to 3 slot
times. After the third collision (i.e. c = 3), the station will wait anything between 0 to 7 slot
times, and so forth.
Step-4: If the station selects a number 𝑘 in the range 0 and 2^c – 1, then
Back_off_time = k × Time slot,
where a time slot is equal to round trip time (RTT).
Step-5: And at the end of the backoff time, the station attempts retransmission by
continuing with the CSMA/CD algorithm.
Step-6: If the maximum number of retransmission attempts is reached, then the station
aborts transmission.
- Framing in the data link layer is a point-to-point connection between the sender and
receiver. The framing is the primary function of the data link layer and it provides a
way to transmit data between the connected devices.
- Framing uses frames to send or receive data. The data link layer receives
packets from the network layer and converts them into frames.
Parts of a Frame
A frame has the following parts −
Frame Header − It contains the source and the destination addresses of the frame.
Payload field − It contains the message to be delivered.
Trailer − It contains the error detection and error correction bits.
Flag − It marks the beginning and end of the frame.
Types of Framing
Framing can be of two types, fixed sized framing and variable sized framing.
1. Fixed-sized Framing: Here the size of the frame is fixed and so the frame length acts as a
delimiter of the frame. Consequently, it does not require additional boundary bits to identify
the start and end of the frame. Example − ATM cells.
2. Variable – Sized Framing: Here, the size of each frame to be transmitted may be different.
So additional mechanisms are kept to mark the end of one frame and the beginning of the
next frame. It is used in local area networks.
IMPORTANCE OF FRAMING:
- Due to various topologies used across the networks, the Maximum
transmission unit differs. Framing does the job for it.
- A frame is also used to wrap the payload with additional information such as
addressing information and checksum. Data link layer also delineates the
frames, commonly termed as Frame synchronisation.
UNIT-3
1 Defi Virtual Circuit is the connection oriented On other hand Datagram is the
nitio service in which there is a connection less service where no
n implementation of resources like buffers, such resources are required for the
CPU, bandwidth, etc., used by virtual data transmission.
circuit for a data transfer session.
2 Path In Virtual circuits as all the resources and On other hand in case Datagram
bandwidth get reserved before the network, the path is not fixed as
transmission, the path which is utilized data packets are free to decide the
or followed by first data packet would path on any intermediate router on
get fixed and all other data packets will the go by dynamically changing
use the same path and consume same routing tables on routers.
resources.
3 Hea As there is same path followed by all the On other hand different headers
der data packets, a common and same with information of other data
header is being used by all the packets. packet is being used in Datagram
network.
5 Relia Due to fixed path and assurance of fixed On other hand Datagram network
bility resources, Virtual Circuits are more due to dynamic resource allocation
reliable for data transmission as and follow dynamic path is more
compared to Datagram network. prone to error and is less reliable
than Virtual circuits.
6 Exa Virtual circuits are costlier in installation On the other hand Datagram
mple and maintenance and are widely used by network are cheaper as compared
and ATM (Asynchronous Transfer Mode) to the Virtual Circuits and are
Cost Network, which is used for the mainly used by IP network, which
Telephone calls. is used for Data services like
Internet.
A non-adaptive algorithm
An adaptive algorithm involves involves a network
1. routers for exchanging and administrator for the manual
updating router table data. entry of the routing paths into
the router.
Whereas in a non-adaptive
In adaptive routing algorithm, the
routing algorithm, the routing
routing decisions are made based
4. decisions are not made based on
on network traffic and topology.
network traffic and topology.
IPv4 IPv6
It Supports Manual
It supports Auto and renumbering address
and DHCP address
configuration
configuration
It can generate
Address space of IPv6 is quite large it can produce
4.29×109 address
3.4×1038 address space
space
The Security
feature is IPSEC is an inbuilt security feature in the IPv6
dependent on protocol
application
Address
representation of Address Representation of IPv6 is in hexadecimal
IPv4 is in decimal
Fragmentation
performed by
In IPv6 fragmentation performed only by the sender
Sender and
forwarding routers
In IPv4 checksum
In IPv6 checksum field is not available
field is available
It has broadcast
Message In IPv6 multicast and anycast message transmission
Transmission scheme is available
Scheme
In IPv4 Encryption
and Authentication In IPv6 Encryption and Authentication are provided
facility not
provided
IPv4 consist of 4
IPv6 consists of 8 fields, which are separated by
fields which are
colon (:)
separated by dot (.)
IPv4’s IP addresses
are divided into
five different IPv6 does not have any classes of IP address.
classes. Class:
A,B,C,D & E
Advantages of Flooding
● It is very simple to setup and implement, since a router may know only its
neighbours.
● It is extremely robust. Even in case of malfunctioning of a large number
routers, the packets find a way to reach the destination.
● All nodes which are directly or indirectly connected are visited. So, there
are no chances for any node to be left out. This is a main criteria in case of
broadcast messages.
● The shortest path is always chosen by flooding.
Disadvantages:-
● Flooding tends to create an infinite number of duplicate data packets, unless
some measures are adopted to damp packet generation.
● It is wasteful if a single destination needs the packet, since it delivers the
data packet to all nodes irrespective of the destination.
● The network may be clogged with unwanted and duplicate data packets.
This may hamper delivery of other data packets.
Version (VER) -This 4-bit field defines the version of the IPv4 protocol.
Currently the version is 4.
• Header length (HLEN)- This 4-bit field defines the total length of the
datagram header in 4-byte words.
Total length.- This is a In-bit field that defines the total length (header plus
data) of the IPv4 datagram in bytes.
Length of data =total length - header length
• Identification -This field is used in fragmentation (discussed in the next
section).
• Flags- This field is used in fragmentation (discussed in the next section).
• Fragmentation offset- A datagram can travel through different networks.
Each router decapsulates the IPv4 datagram from the frame it receives,
processes it, and then encapsulates it in another frame.
• Time to live- A datagram has a limited lifetime in its travel through an
internet. This field was originally designed to hold a timestamp, which was
decremented by each visited
router.
• Protocol- This 8-bit field defines the higher-level protocol that uses the
services of the IPv4 layer.
• An IPv4 datagram can encapsulate data from several higher-level protocols
such as TCP, UDP, ICMP, and IGMP
•Checksum- The checksum concept is used to check errors.
•Source address- This 32-bit field defines the IPv4 address of the source. This
field must remain unchanged during the time the IPv4 datagram travels from
the source host to the destination host.
•Destination address- This 32-bit field defines the IPv4 address of the
destination. This field must remain unchanged during the time the IPv4
datagram travels from the source host to the destination host.
Hop Count : Hop count is the number of routers occurring in between the
source and destination network. The path with the lowest hop count is
considered as the best route to reach a network and therefore placed in the
routing table. RIP prevents routing loops by limiting the number of hops
allowed in a path from source and destination. The maximum hop count
allowed for RIP is 15 and a hop count of 16 is considered as network
unreachable.
Features of RIP
1. Updates of the network are exchanged periodically.
2. Updates (routing information) are always broadcast.
3. Full routing tables are sent in updates.
4. Routers always trust routing information received from neighbour routers.
This is also known as Routing on rumours.
RIP versions : There are three versions of routing information protocol – RIP
Version1, RIP Version2, and RIPng.
OSPF states – The device operating OSPF goes through certain states. These
states are:
Down – In this state, no hello packets have been received on the interface.
#Note – The Downstate doesn’t mean that the interface is physically down.
Here, it means that the OSPF adjacency process has not started yet.
INIT – In this state, hello packets have been received from the other router.
2WAY – In the 2WAY state, both the routers have received the hello packets
from other routers. Bidirectional connectivity has been established.
Exstart – In this state, NULL DBD are exchanged. In this state, the master and
slave elections take place. The router having the higher router I’d become the
master while the other becomes the slave.
Exchange – In this state, the actual DBDs are exchanged.
Loading – In this state, LSR, LSU, and LSA (Link State Acknowledgement) are
exchanged.
Full – In this state, synchronisation of all the information takes place. OSPF
routing can begin only after the Full state.
CONFIGURATION
15. Differentiate Distance vector routing & Link state routing.
A)
16. To solve the examples related to identifying netid, hostid, subnet mask.
It provides transition strategies that convert IPv4 into IPv6, and these strategies are as
follows:
★ Dual stacking: It allows us to have both the versions, i.e., IPv4 and IPv6, on the same
device.
★ Tunnelling: In this approach, all the users who have IPv6 communicate with an IPv4
network to reach IPv6.
★ Network Address Translation: The translation allows the communication between the
hosts having a different version of IP.
A Firewall analyses the network traffic and filters it so that the unsecured and
suspicious networks cannot attack the system. The point where information is
exchanged with an external network is called a port. A firewall welcomes only
those incoming traffic that has been configured to accept. It distinguishes
between good and malicious traffic and either allows or blocks specific data
packets on pre-established security rules.
Flow routing uses adaptive routing algorithms that base their decisions on the
traffic conditions between a computer and all the other computers it is
connected to on the subnetwork. Based on the traffic within this subnetwork,
flow routing makes the decision about which computer to send a packet to.
The IPv6 is a network layer protocol that allows communication and data
transfer between two different hosts. It sets specific rules that help identify
the separate hosts and track their location. That way, they could exchange
information successfully. Only when the two corresponding IP addresses are
identified, the route could be established, and the hosts are able to
communicate.
Advantages of IPv6
➔ It increases the capacity of address space – That way, the different resources
are efficiently distributed to the adapted additional web addresses.
➔ Routing is efficient – It gives a possibility of easy aggregation of prefixes
assigned to IP networks.
➔ Efficient Data Flow – It allows the transfer of large data packets
simultaneously. That helps with preserving bandwidth.
➔ Security– It improves safety and security based on the improved
authentication methods built into network firewalls.
Working: The devices of the network peel the header of the data link layer
from the protocol data unit (PDU) called frame and transfer the packet to the
network layer (layer 3 of OSI) where the network ID of the packet is validated
with the destination IP’s network ID of the packet and if it’s equal then it
responds to the source with the MAC address of the destination, else the
packet reaches the gateway of the network and broadcasts packet to the
devices it is connected with and validates their network ID.
The above process continues till the second last network device in the path
reaches the destination where it gets validated and ARP, in turn, responds
with the destination MAC address.
ARP Cache: After resolving the MAC address, the ARP sends it to the source
where it is stored in a table for future reference.
ARP Cache Timeout: It indicates the time for which the MAC address in the
ARP cache can reside.
ARP request: This is nothing but broadcasting a packet over the network to
validate whether we came across the destination MAC address or not.
- The physical address of the sender.
- The IP address of the sender.
- The IP address of the receiver
ARP response/reply: It is the MAC address response that the source receives
from the destination which aids in further communication of the data.
25. With a real time scenario explain IP addressing and subnetting.
A)
26. Compare distance vector routing and link state routing.
A)
27. Explain Flooding.
A) Flooding is a non-adaptive routing technique following this simple method:
when a data packet arrives at a router, it is sent to all the outgoing links except the
one it has arrived on. For example, let us consider the network in the figure, having
six routers that are connected through transmission lines.
UNIT - 4
1. Define the socket. List the types of sockets.
Types of Sockets :
There are two types of Sockets: the datagram socket and the stream socket.
1. Datagram Socket :
This is a type of network which has connection less point for sending
and receiving packets. It is similar to mailbox. The letters (data) posted
into the box are collected and delivered (transmitted) to a letterbox
(receiving socket).
2. Stream Socket
In Computer operating system, a stream socket is type of interprocess
communications socket or network socket which provides a
connection-oriented, sequenced, and unique flow of data without
record boundaries with well defined mechanisms for creating and
destroying connections and for detecting errors. It is similar to phone.
A connection is established between the phones (two ends) and a
conversation (transfer of data) takes place.
2. List the duties of the transport layer and explain each in brief.
Congestion Control:
Congestion is a situation in which too many sources over a network attempt
to send data and the router buffers start overflowing due to which loss of
packets occur. As a result, retransmission of packets from the sources
increases the congestion further. In this situation, the Transport layer provides
icmpCongestion Control in different ways. It uses open loop congestion
control to prevent the congestion and closed-loop congestion control to
remove the congestion in a network once it occurs. TCP provides AIMD-
additive increase multiplicative decrease, leaky bucket technique for
congestion control.
Flow control:
The transport layer provides a flow control mechanism between the adjacent
layers of the TCP/IP model. TCP also prevents data loss due to a fast sender
and slow receiver by imposing some flow control techniques. It uses the
method of sliding window protocol which is accomplished by the receiver by
sending a window back to the sender informing the size of data it can receive.
TCP is reliable as it
The delivery of data to
guarantees the delivery
Reliability the destination cannot
of data to the
be guaranteed in UDP.
destination router.
Sequencing of data is a
There is no sequencing of
feature of Transmission
data in UDP. If the order
Control Protocol (TCP).
Sequence is required, it has to be
this means that packets
managed by the
arrive in order at the
application layer.
receiver.
It’s a connectionless
Handshaking Uses handshakes such
protocol i.e. No
Techniques as SYN, ACK, SYN-ACK
handshake
UDP header :
UDP header is an 8-bytes fixed and simple header. The first 8 Bytes contain all
necessary header information and the remaining part consist of data. UDP
port number fields are each 16 bits long, therefore the range for port numbers
defined from 0 to 65535; port number 0 is reserved. Port numbers help to
distinguish different user requests or processes.
OR
8. Draw and explain TCP Header.
The Transmission Control Protocol (TCP) header is the first 24 bytes of a TCP
segment that contains the parameters and state of an end-to-end TCP socket. The
TCP header tracks the state of communication between two TCP endpoints.
Uses :
Used by TCP/IP protocols at N/W layer
Unreliable and Connection - less
The TCP header format is classified into various fields that are as follows:
● Source port
● Destination port
● Sequence number
● Acknowledgement number
● HLEN
● Control Flag Bits
● Window size
● Checksum
● Options
Source Port
It defines the port number of the application program in the sender's host. The
source port is 16 bits in size.
Destination Port
It defines the port number of the application program in the receiver's host.
The destination port is 16 bits in size.
Sequence Nnmber
It conveys to the receiving host which octet in this sequence comprises the
first byte in the segment. The sequence number is a 32-bit field. TCP assigns
the unique sequence number to each byte of data contained in the TCP
segment.
Acknowledgement Number
HLEN
This field specifies the number of 32-bit words present in the TCP header. This
field helps the receiver to know from where the actual data begins. The HLEN
field is of 4 bits, and it ranges from 20 bytes to 60 bytes in tcp header size.
The control flag bit is 6 bits. The control flag field is basically divided into the
following felids that are as follows:
Window Size
It tells how many bytes may be sent, starting at the acknowledged byte. It
advertises how much data (in bytes) the sender can receive without
acknowledgement. Thus, the window size is used for Flow Control.
Checksum
The checksum is used for error detection. It checksums the data, header, and
pseudo-header. The sender adds CRC checksum to the checksum field before
sending the data. The receiver rejects the data that fails the CRC check.
Options
The options field is used for several purposes. The options field contains 40
bytes of information. Some widely used options are:
● The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
● HTTP is similar to the FTP as it also transfers the files from one host to
another host. But, HTTP is simpler than FTP as HTTP uses only one
connection, i.e., no control connection to transfer the files.
● Each node in a tree has a domain name, and a full domain name is a
sequence of symbols specified by dots.
21. Source Port: Source Port is a 2 Byte long field used to identify the port
number of the source.
22. Destination Port: It is a 2 Byte long field, used to identify the port of
the destined packet.
23. Length: Length is the length of UDP including the header and the data.
It is a 16-bits field.
24. Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s
complement of the one’s complement sum of the UDP header, the
pseudo-header of information from the IP header, and the data,
padded with zero octets at the end (if necessary) to make a multiple of
two octets.