Department of Computer Science and Engineering: 2. What Is Network Software?
Department of Computer Science and Engineering: 2. What Is Network Software?
Department of Computer Science and Engineering: 2. What Is Network Software?
2 Marks
1. list the requirements to building a network
Scalable Connectivity
Cost-Effective Resource Sharing
Support for Common Services
Manageability
4. Define API
Application Programming Interface (Sockets)
The place to start when implementing a network application is the interface exported by
the network. Since most network protocols are implemented in software, and nearly all computer
systems implement their network protocols as part of the operating system, when we refer to the
interface “exported by the network,” we are generally referring to the interface that the OS
provides to its networking subsystem. This interface is often called the network application
programming interface (API)
5. What are the three criteria necessary for an effective and efficient network?
The most important criteria are
Performance
Reliability
Security.
Performance of the network depends on number of users, type of transmission medium, and the
capabilities of the connected h/w and the efficiency of the s/w. Reliability is measured by
frequency of failure, the time it takes a link to recover from the failure and the network’s
robustness in a catastrophe. Security issues include protecting data from unauthorized access and
viruses.
1
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Two features:
It decomposes the problem of building a network into more manageable components.
It provides a more modular design.
12. What is spread spectrum and explain the two types of spread spectrum?
Spread spectrum is to spread the signal over a wider frequency band than normal in such
a way as to minimize the impact of interference from other devices.
Frequency Hopping
Direct sequence
16. Mention the types of errors and define the terms? (MAY 2012)
There are 2 types of errors
Single-bit error.
Burst-bit error.
Single bit error: The term single bit error means that only one bit of a given data unit (such as
byte character/data unit or packet) is changed from 1 to 0 or from 0 to 1.
Burst error: Means that 2 or more bits in the data unit have changed from 1 to 0 from 0 to 1.
31. For n devices in a network, what is the number of cable links required for a mesh and
ring topology?
Mesh topology – n (n-1)/2
Ring topology – n
33. What are the two types of line configuration? (NOV 2010)
4
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Point-to-point & Multipoint
36. What is the use of Two dimensional parity in error detection? (NOV 2012)
It is based on simple parity.
It performs calculation for each bit position across each byte in the frame.
This adds extra parity byte for entire frame, in addition to a parity bit for each byte.
37. What are the issues(Services) in data link layer? (NOV 2012) (May 2016) (Nov 2016)
a) Services Provided to the Network Layer
b) Framing
c) Error Control
d) Flow Control
41. What are the major duties of network layer? (MAY 2012)
5
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Logical addressing - If a packet passes the n/w boundary, we need another addressing
system for source and destination called logical address.
Routing – The devices which connects various networks called routers are responsible
for delivering packets to final destination.
45. What is protocol? What are its key elements? (NOV/DEC 2007) (May 2016)
Set of rules that govern the data communication is protocol. The key elements are
i) Syntax ii) Semantics iii) Timing
46. Define (or) mechanism of stop and wait protocol (Nov 2016)
The idea of stop-and-wait is straightforward: After transmitting one frame, the sender
waits for an acknowledgment before transmitting the next frame. If the acknowledgment does
not arrive after a certain period of time, the sender times out and retransmits the original frame.
6
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Application Layer
16 MARKS
Advantages of Network
Speed. Sharing and transferring files within Networks are very rapid. Thus saving time,
while maintaining the integrity of the file.
Cost. Individually licensed copies of many popular software programs can be costly.
Networkable versions are available at considerable savings. Shared programs, on a
network allows for easier upgrading of the program on one single file server, instead of
upgrading individual workstations.
Security. Sensitive files and programs on a network are passwords protected or
designated as "copy inhibit," so that you do not have to worry about illegal copying of
programs.
Centralized Software Management. Software can be loaded on one computer (the file
server) eliminating that need to spend time and energy installing updates and tracking
files on independent computers throughout the building.
Resource Sharing. Resources such as, printers, fax machines and modems can be
shared.
Electronic Mail. E-mail aids in personal and professional communication.
Flexible Access. Access their files from computers throughout the firm.
7
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Workgroup Computing. Workgroup software (such as Microsoft BackOffice) allows
many users to work on a document or project concurrently.
Disadvantages of Network
Types of Network
WAN (Wide Area Network) A WAN spans a large geographic area, such as a state, province
or country. WANs often connect multiple smaller networks, such as local area networks (LANs)
or metro area networks (MANs). The world's most popular WAN is the Internet.
TYPE OF CONNECTION:
There are two types are,
1. Point to point
2. Multi point
1. Point To Point:
It provides a dedicated link between two devices of the channel. The entire capacity of
the channel is reserved for transmission between those two devices.
2. Multipoint:
9
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
More than two devices can share a link by using this type of connection. It also called as
multidrop. The capacity channel is shared either temporary or spatially. It simultaneously use, it
is spatially shared. If it takes turns, it is time shared line configuration
Topology refers to the way a network is laid out either physically or logically. Two or
more devices connect to a link; two or more links form a topology. It is the geographical
representation of the relationship of all the links and linking devices to each other.
1. Mesh
2. Star
3. Tree
4. Bus
5. Ring
6. Hybrid
1. Mesh Topology:
Here every device has a dedicated point to point link to every other device. A fully connected
mesh can have n(n-1)/2 physical channels to link n devices. It must have n-1 IO ports.
Advantages:
1. They use dedicated links so each link can only carry its own data load. So traffic
problem can be avoided.
2. It is robust. If any one link get damaged it cannot affect others
3. It gives privacy and security
4. Fault identification and fault isolation are easy.
Disadvantages:
1. The amount of cabling and the number IO ports required are very large. Since every
device is connected to each other devices through dedicated links.
2. The sheer bulk of wiring is larger then the available space
3. Hardware required to connect each device is highly expensive.
Example:
A mesh network has 8 devices. Calculate total number of cable links and IO ports needed.
Solution:
Number of devices = 8
10
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Number of links = n (n-1)/2
= 8(8-1)/2
= 28
Number of port/device = n-1
= 8-1 = 7
2. STAR TOPOLOGY:
Here each device has a dedicated link to the central ‘hub’. There is no direct traffic
between devices. The transmission are occurred only through the central controller namely hub.
Advantages:
1. Less expensive then mesh since each device is connected only to the hub.
2. Installation and configuration are easy.
3. Less cabling is need then mesh.
4. Robustness.
5. Easy to fault identification & isolation.
Disadvantages:
1. Even it requires less cabling then mesh when compared with other topologies it still
large.
3. TREE TOPOLOGY:
It is a variation of star. Instead of all devices connected to a central hub here most of the
devices are connected to a secondary hub that in turn connected with central hub. The central
hub is an active hub. An active hub contains a repeater, which regenerate the received bit pattern
before sending.
11
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
The secondary hub may be active or passive. A passive hub means it just precedes a physical
connection only.
Advantages:
1. Can connect more than star.
2. The distance can be increased.
3. Can isolate and prioritize communication between different computers.
4. BUS TOPOLOGY:
A bus topology is multipoint. Here one long cable is act as a backbone to link all the
devices are connected to the backbone by drop lines and taps. A drop line is the connection
between the devices and the cable. A tap is the splice into the main cable or puncture the
sheathing.
Advantages:
1. Ease of installation.
2. Less cabling.
Disadvantages:
1. Difficult reconfiguration and fault isolation.
2. Difficult to add new devices.
3. Signal reflection at top can degradation in quality
4. If any fault in backbone can stops all transmission
5. Ring topology
Each node is connected to exactly two other nodes, forming a ring. Can be visualized as a
circular configuration. Requires at least three nodes
Advantages:
1. Easy to install.
12
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
2. Easy to reconfigure.
3. Fault identification is easy.
Disadvantages:
1. Unidirectional traffic.
2. Break in a single ring can break entire network.
6. Hybrid topology
A combination of any two or more network topologies.
Scalable Connectivity
Cost-Effective Resource Sharing
Support for Common Services
Manageability
1. Scalable Connectivity
Networks (of which the Internet is the prime example) are designed to grow in a way that
allows them the potential to connect all the computers in the world. A system that is designed to
support growth to an arbitrarily large size is said to scale.
The cloud distinguishes between the nodes on the inside that implement the network (they are
commonly called switches, and their primary function is to store and forward packets) and the
nodes on the outside of the cloud that use the network (they are commonly called hosts, and they
support users and run application programs).
14
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
4. Manageability
Managing a network includes making changes as the network grows to carry more traffic
or reach more users, and troubleshooting the network when things go wrong or performance isn’t
as desired. This requirement is partly related to the issue of scalability discussed above—as the
Internet has scaled up to support billions of users and at least hundreds of millions of hosts, the
challenges of keeping the whole thing running correctly and correctly configuring new devices
as they are added have become increasingly problematic.
5. Discuss layering and protocols in detail (or) OSI layers (or) Network architecture
(Nov 2015) (Nov 2016)
Network Architecture
Networks do not remain fixed at single point in time, but it must evolve to accommodate
changes based on the technologies on which they are based and demands made by application
programmer.
Network architecture guides the design and implementation of network. Two commonly
used architecture are
OSI Architecture
Internet or TCP/IP architecture
Protocols
A protocol is a set of rules that governs data communication. It defines what is
communicated, how it is communicated, and when it is communicated. The key elements of a
protocol are syntax, semantics and timing.
Each protocol defines two different interfaces.
Service interface - to the other objects on the same computer that want to use its
communication services. This service interface defines the operations that local
objects can perform on the protocol.
Peer interface - to its counterpart (peer) on another machine. It also defines the
form and meaning of messages exchanged between protocol peers to implement
the communication service.
15
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Encapsulation
Control information must be added with the data to instruct the peer how to handle with
the received message. It will be added into the header or trailer.
Header - Small data structure from few bytes to few kilobytes attached to the front of
message.
Trailer – Information will be added at the end of the message
Payload or message body – Data send by the program
In this case data is encapsulated with new message created by protocol at each level.
Physical Layer.
Data link Layer.
Network Layer.
Transport Layer.
Session Layer.
Presentation Layer.
16
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Application Layer
3. NETWORK LAYER
This layer is responsible for the delivery of packets from source to destination.
It is mainly required, when it is necessary to send information from one network to
another.
The other responsibilities of this layer are
Logical addressing - If a packet passes the n/w boundary, we need another addressing
system for source and destination called logical address.
Routing – The devices which connects various networks called routers are responsible
for delivering packets to final destination.
4. TRANSPORT LAYER
It is responsible for Process to Process delivery.
It also ensures whether the message arrives in order or not.
5. SESSION LAYER
This layer establishes, manages and terminates connections between applications.
The other responsibilities of this layer are
Dialog control - This session allows two systems to enter into a dialog either in half
duplex or full duplex.
Synchronization-This allows to add checkpoints into a stream of data.
6. PRESENTATION LAYER
It is concerned with the syntax and semantics of information exchanged between two
systems.
The other responsibilities of this layer are
Translation – Different computers use different encoding system, this layer is
responsible for interoperability between these different encoding methods. It will change
the message into some common format.
Encryption and decryption-It means that sender transforms the original information to
another form and sends the resulting message over the n/w. and vice versa.
Compression and expansion-Compression reduces the number of bits contained in the
information particularly in text, audio and video.
7. APPLICATION LAYER
This layer enables the user to access the n/w. This allows the user to log on to remote user.
The other responsibilities of this layer are
FTAM (file transfer, access, mgmt) - Allows user to access files in a remote host.
Mail services - Provides email forwarding and storage.
Directory services - Provides database sources to access information about various
sources and objects.
19
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Below the internet layer is great void. The TCP/IP reference model does not really say such
about what happen here, except to point out that the host has connect to the network using some
protocol so it can transmit IP packets over it. This protocol is not specified and varies from host
to host and network to network.
2) Internet layer:
Packet switching network depends upon a connectionless internetwork layer. This layer is known
as internet layer, is the linchpin that holds the whole design together. Its job is to allow hosts to
insert packets into any network and have them to deliver independently to the destination. They
may appear in a different order than they were sent in each case it is job of higher layers to
rearrange them in order to deliver them to proper destination.
The internet layer specifies an official packet format and protocol known as internet protocol.
The job of internet layer is to transport IP packets to appropriate destination. Packet routing is
very essential task in order to avoid congestion. For these reason it is say that TCP/IP internet
layer perform same function as that of OSI network layer.
20
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
3) Transport layer:
In the TCP/IP model, the layer above the internet layer is known as transport layer. It is
developed to permit entities on the source and destination hosts to carry on a conversation. It
specifies 2 end-to-end protocols
i) TCP (Transmission Control Protocol)
ii) UDP (User Datagram Protocol)
TCP
It is a reliable connection-oriented protocol that permits a byte stream originating on one
machine to be transported without error on any machine in the internet. It divides the incoming
byte stream into discrete message and passes each one onto the internet layer. At the destination,
the receiving TCP process collects the received message into the output stream. TCP deals with
flow control to make sure a fast sender cannot swamp a slow receiver with more message than it
can handle.
UDP
It is an unreliable, connectionless protocol for applications that do not want TCP’s sequencing on
flow control and wish to offer their own. It is also used for client-server type request-reply
queries and applications in which prompt delivery is more important than accurate delivery such
as transmitting speech or video.
4) Application Layer:
In TCP/IP model, session or presentation layer are not present. Application layer is present on
the top of the Transport layer. It includes all the higher-level protocols which are virtual terminal
(TELNET), file transfer (FTP) and electronic mail (SMTP).
The virtual terminal protocol permits a user on one machine to log into a distant machine and
work there. The file transfer protocol offers a way to move data efficiently from one machine to
another. Electronic mail was used for file transfer purpose but later a specialized protocol was
developed for it.
SMTP makes use of TCP to establish a connection to the remote mail host, the mail is sent, any
waiting mail is requested and then the connection is disconnected. It can also return a forwarding
address if the intended recipient no longer receives email at that destination. To enable mail to be
delivered across differing systems, a mail gateway is used.
The significance of this is that new functionality can be added readily with “just a small
matter of programming.” As a result, new applications and services—electronic commerce,
videoconferencing, and IP telephony, to name a few—have been showing up at an incredible
pace.
The place to start when implementing a network application is the interface exported by
the network. Since most network protocols are implemented in software (especially those high in
the protocol stack), and nearly all computer systems implement their network protocols as part of
the operating system, when we refer to the interface “exported by the network,” we are generally
referring to the interface that the OS provides to its networking subsystem. This interface is often
called the network application programming interface (API)
Although each operating system is free to define its own network API (and most have),
over time certain of these APIs have become widely supported; that is, they have been ported to
operating systems other than their native system. This is what has happened with the socket
22
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
interface originally provided by the Berkeley distribution of Unix, which is now supported in
virtually all popular operating systems, and is the foundation of language-specific interfaces,
such as the Java socket library. The advantages of industry-wide support for a single API are that
applications can be easily ported from one OS to another and developers can easily write
applications for multiple operating systems.
The main abstraction of the socket interface, not surprisingly, is the socket. A good way
to think of a socket is as the point where a local application process attaches to the network. The
interface defines operations for creating a socket, attaching the socket to the network, sending/
receiving messages through the socket, and closing the socket. To simplify the discussion, we
will limit ourselves to showing how sockets are used with TCP.
The first step is to create a socket, which is done with the following operation:
The reason that this operation takes three arguments is that the socket interface was designed to
be general enough to support any underlying protocol suite. Specifically, the domain argument
specifies the protocol family that is going to be used: PF INET denotes the Internet family, PF
UNIX denotes the Unix pipe facility, and PF PACKET denotes direct access to the network
interface (i.e., it bypasses the TCP/IP protocol stack).
The type argument indicates the semantics of the communication. SOCK STREAM is
used to denote a byte stream. SOCK DGRAM is an alternative that denotes a message-oriented
service, such as that provided by UDP. The protocol argument identifies the specific protocol
that is going to be used. In our case, this argument is UNSPEC because the combination of PF
INET and SOCK STREAM implies TCP. Finally, the return value from socket is a handle for
the newly created socket—that is, an identifier by which we can refer to the socket in the future.
It is given as an argument to subsequent operations on this socket.
The next step depends on whether you are a client or a server. On a server machine, the
application process performs a passive open—the server says that it is prepared to accept
connections, but it does not actually establish a connection. The server does this by invoking the
following three operations:
The bind operation, as its name suggests, binds the newly created socket to the specified address.
This is the network address of the local participant—the server
The listen operation then defines how many connections can be pending on the specified
socket. Finally, the accept operation carries out the passive open.
On the client machine, the application process performs an active open; that is, it says
who it wants to communicate with by invoking the following single operation:
23
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Once a connection is established, the application processes invoke the following two operations
to send and receive data:
int send(int socket, char *message, int msg len, int flags)
int recv(int socket, char *buffer, int buf len, int flags)
The first operation sends the given message over the specified socket, while the second operation
receives a message from the specified socket into the given buffer. Both operations take a set of
flags that control certain details of the operation
The second performance metric, latency, corresponds to how long it takes a message to
travel from one end of a network to the other. (As with bandwidth, we could be focused on the
latency of a single link or an end-to-end channel.) Latency is measured strictly in terms of time.
Latency = Propagation+Transmit+Queue
Propagation = Distance/Speed Of Light
Transmit = Size/Bandwidth
Delay×Bandwidth Product
It is also useful to talk about the product of these two metrics, often called the delay
×bandwidth product. Intuitively, if we think of a channel between a pair of processes as a hollow
pipe (see Figure 1.18), where the latency corresponds to the length of the pipe and the bandwidth
gives the diameter of the pipe, then the delay×bandwidth product gives the volume of the pipe
24
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
the maximum number of bits that could be in transit through the pipe at any given instant. Said
another way, if latency (measured in time) corresponds to the length of the pipe, then given the
width of each bit (also measured in time) you can calculate how many bits fit in the pipe.
The delay×bandwidth product is important to know when constructing high-performance
networks because it corresponds to how many bits the sender must transmit before the first bit
arrives at the receiver
High-Speed Networks
The bandwidths available on today’s networks are increasing at a dramatic rate, and there
is eternal optimism that network bandwidth will continue to improve. This causes network
designers to start thinking about what happens in the limit or, stated another way, what is the
impact on network design of having infinite bandwidth available.
Although high-speed networks bring a dramatic change in the bandwidth available to
applications, in many respects their impact on how we think about networking comes in what
does not change as bandwidth increases: the speed of light.
The effective end-to-end throughput that can be achieved over a network is given by the
simple relationship
Throughput = TransferSize/TransferTime
where Transfer Time includes not only the elements of one-way Latency identified earlier in this
section, but also any additional time spent requesting or setting up the transfer. Generally, we
represent this relationship as
TransferTime = RTT+1/Bandwidth × TransferSize
We use RTT in this calculation to account for a request message being sent across the network
and the data being sent back.
9. Explain framing concepts in detail (or) Discuss link layer services (or) Issues in
data link layer (or) Discuss HDLC & PPP (Nov/Dec 2014) (May 2016)
To transmit frames over the node it is necessary to mention start and end of each frame. There are
three techniques to solve this frame
Byte-Oriented Protocols (BISYNC, PPP, DDCMP)
Bit-Oriented Protocols (HDLC)
Clock-Based Framing (SONET)
Byte-Counting Approach
The number of bytes contained in a frame can he included as a field in the frame header.
DDCMP protocol is used for this approach. The frame format is
26
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
COUNT Field specifies how many bytes are contained in the frame’s body.
Sometime count field will be corrupted during transmission, so the receiver will
accumulate as many bytes as the COUNT field indicates. This is sometimes called a
framing error.
The receiver will then wait until it sees the next SYN character.
HDLC denotes both the beginning and the end of a frame with the distinguished bit
sequence 01111110.
This sequence might appear anywhere in the body of the frame, it can be avoided by bit
stuffing.
On the sending side, any time five consecutive 1’s have been transmitted from the body
of the message (i.e., excluding when the sender is trying to transmit the distinguished
01111110 sequence), the sender inserts a 0 before transmitting the next bit.
On the receiving side, five consecutive 1’s arrived, the receiver makes its decision based
on the next bit it sees (i.e., the bit following the five is).
If the next bit is a 0, it must have been stuffed, and so the receiver removes it. If the next
bit is a 1, then one of two things is true, either this is the end-of-frame marker or an error
has been introduced into the bit stream.
By looking at the next bit, the receiver can distinguish between these two cases:
7 If it sees a 0 (i.e., the last eight bits it has looked at are 01111110), then it is the end-of-
frame marker.
8 If it sees a 1 (i.e., the last eight bits it has looked at are 01111111), then there must have
been an error and the whole frame is discarded.
It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are
overhead, with the rest being available for data.
27
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that
enable the receiver to determine where the frame starts.
The receiver looks for the special bit pattern consistently, once in every 810 bytes, since
each frame is 9 x 90 = 810 bytes long.
The STS-N frame can he thought of as consisting of N STS-1 frames, where the bytes
from these frames are interleaved; that is, a byte from the first frame is transmitted, then a
byte from the second frame is transmitted, and so on.
Payload from these STS-1 frames can he linked together to form a larger STS-N payload,
such a link is denoted STS-Nc. One of the bit in overhead is used for this purpose.
10. Explain Error detection techniques or Error detecting codes (NOV 2012)
(MAY 2012) (Nov 2014) (May 2015) (May 2016)
Data can be corrupted during transmission. For reliable communication, errors must be detected
and corrected.
Types of Errors
Single-bit error
The term Single-bit error means that only one bit of a given data unit (such as byte, character, data unit
or packet) is changed from 1 to 0 or from 0 to 1.
Burst Error
The term Burst Error means that two or more bits in the data unit have changed from 1 to 0 or from 0
to 1.
28
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Error detection
Redundancy
One method is to send every data twice, so that receiver checks every bit of two copies and
detect error.
Drawbacks
Sends n-redundant bits for n-bit message.
Many errors are undetected if both the copies are corrupted.
Instead of adding entire data, some bits are appended to each unit.
This is called redundant bit because the bits added will not give any new information. These bits
are called error detecting codes.
1)Parity Check
For example frame containing 6 bytes of data. In this third bit of the parity byte is 1 since there
are an odd number of 1’s is in the third bit across the 6 bytes in the frame.
In this case, 14 bits of redundant information are added with original information.
29
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
In the sender side all the words are added and then transmit the result of sum called
checksum with the data.
The receiver performs the same calculation on the received data and compares the result
with the received checksum.
Sender Receiver
7 7
5 5
9 9
Sum 21 9
Check Sum 9 Sum 30
Check Sum 0
1010 1
1 1111 0
1
0110
9 1001 15 1111
0 0000
If any transmitted data, including the checksum itself, is corrupted, then the results will
not match, so the receiver knows that an error occurred.
Instead of sending the checksum as such, one’s complement of that sum will be send to
the receiver. If the receiver gets the result as zero then it will be the correct one.
In this, we can represent unsigned number from 0 to 2n using n bits.
If the number has more than n bits, the extra leftmost bits need to be added to the n
rightmost bits.
Data can be divided in to 16 bit word and the Checksum is initialized to zero.
Steps
30
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Append k-1 zeros with M(x) – P(x)
Divide P(x) by C(x)
Subtract the remainder from T(x)
Subtraction is made by making XOR operation
11. Discuss link level flow control (or) Reliable transmission (or) Explain the
various flow control mechanisms (MAY 2013) (NOV 2012) (Nov 2015)
Flow control is a technique that a transmitting entity does not conquer a receiving entity with
data. Two fundamental mechanisms are acknowledgement and timeouts.
After getting each frame the receiver will send ACK to sender.
If the sender does not receive ACK up to reasonable amount of time then it retransmit the
original frame waiting for reasonable amount of time is called timeout.
If the acknowledgment does not arrive after a certain period of time, the sender times out
and retransmit the original frame.
31
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
a) The ACK is received before the timer expires b) The original frame is lost
Fig: illustrates four different scenarios that result from this basic algorithm. The sending side is
represented on the left, the receiving side is depicted on the right, and time flows from top to
bottom.
In Fig (a) ACK is received before the timer expires, (b) and (c) show the situation in which
the original frame and the ACK, respectively, are lost, and (d) shows the situation in which
the timeout fires too soon..
Suppose the sender sends a frame and the receiver acknowledges it, but the acknowledgment
is either lost or delayed in arriving. This situation is in (c) and (d). In both cases, the sender
times out and retransmit the original frame, but the receiver will think that it is the next
frame, since it correctly received and acknowledged the first frame.
This makes the receiver to receive the duplicate copies. To avoid this two sequence numbers
(0 and 1) must be used alternatively.
32
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
The main drawback of the stop-and-wait algorithm is that it allows the sender have only one
outstanding frame on the link at a time.
Go – Back N Method
Sender Window
At the beginning of transmission, the sender window contains n-1 frames. As frames are
sent out, the left boundary of the window moves inward, shrinking the size of the window
If size of window is W if three frames have been transmitted since the last
acknowledgement then the number of frames left in the window is w -3.
Once an ACK arrives, the window expands to allow in a number of new frames equal to
the number of frames acknowledged by that ACK.
33
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Receiver Window
The receive window is an abstract concept defining an imaginary box of size 1 with one
single variable Rn.
The window slides when a correct frame has arrived, sliding occurs one slot at a time.
When the timer expires, the sender resends all outstanding frames. For example, suppose the sender
has already sent frame 6, but the timer for frame 3 expires. This means that frame 3 has not been
acknowledged; the sender goes back and sends frames 3, 4,5, and 6 again. That is why the
protocol is called Go-Back-N.
Sender Window
Receiver window
34
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
The Selective Repeat Protocol allows as many frames as the size of the receive window to
arrive out of order and be kept until there is a set of in-order frames to be delivered to the
network layer.
Because the sizes of the send window and receive window are the same, all the frames in the
send frame can arrive out of order and be stored until they can be delivered.
If any frame lost, sender has to retransmit only that lost frames.
The sliding window algorithm works as follows. First, the sender assigns a sequence
number, denoted SeqNum, to each frame. For now, let’s ignore the fact that SeqNum is
implemented by a finite-size header field and instead assume that it can grow infinitely large.
LFS−LAR ≤ SWS
When an acknowledgment arrives, the sender moves LAR to the right, thereby allowing
the sender to transmit another frame. Also, the sender associates a timer with each frame it
transmits, and it retransmits the frame should the timer expire before an ACK is received. Notice
that the sender has to be willing to buffer up to SWS frames since it must be prepared to
retransmit them until they are acknowledged.
The receive window size, denoted RWS, gives the upper bound on the number of outof-
order frames that the receiver is willing to accept;
LAF denotes the sequence number of the largest acceptable frame; and
35
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
LFR denotes the sequence number of the last frame received.
When a frame with sequence number SeqNum arrives, the receiver takes the following
action. If SeqNum ≤ LFR or SeqNum > LAF, then the frame is outside the receiver’s window
and it is discarded. If LFR < SeqNum ≤ LAF, then the frame is within the receiver’s window and
it is accepted.
Now the receiver needs to decide whether or not to send an ACK. Let SeqNumToAck
denote the largest sequence number not yet acknowledged, such that all frames with sequence
numbers less than or equal to SeqNumToAck have been received.
The receiver acknowledges the receipt of SeqNumToAck, even if higher numbered
packets have been received. This acknowledgment is said to be cumulative. It then sets LFR =
SeqNumToAck and adjusts LAF = LFR+RWS.
12. The message 11001001 is to be transmitted, using CRC error detection algorithm.
Assuming the CRC polynomial to be x 3+1, determine the message that should be
transmitted. if the second left most bit is corrupted, shoe that it is detected by the
receiver.(8) (NOV 2013)
36
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
13. Discuss Error Correction (The process of correcting bits) in detail (May 2015)
Error correcting codes are more sophisticated than error-detection codes and require more
redundancy bits.
37
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
In single bit error detection only two states are sufficient.
1) error
2) no error
Two states are not enough to detect an error but not to correct it.
Redundancy Bits
If the total number of bits are m+r, then r must be able to indicate at least m+r+1
different states. r bits can indicate 2r different states. Therefore, 2r must be equal to or
greater than m+r+1
2r >=m+r+1
For example if the value of m is 7 the smallest r value that can satisfy this equation is
4.
Hamming Code
38
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
R.W. Hamming provides a practical solution for the error correction.
Positioning the Redundancy Bits
For example, a seven-bit ASCII code requires four redundancy bits that can be added to
the end of the data or intersperse with the original data bits. These redundancy bits are placed in
positions 1, 2, 4 and 8. We refer these bits as r1, r2, r3 and r4
The combination used to calculate each of the four r values for a seven-bit data sequence are as
follows
The r1 bit is calculated using all bits positions whose binary representation include a
1 in the rightmost position
r2 is calculated using all bit position with a 1 in the second position and so on
r1: bits 1,3,5,7,9,11
r2: bits 2, 3, 6, 7, 10, 11
r3: bits 4, 5, 6, 7
r4: bits 8, 9, 10, 11
Redundancy bits calculation
39
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Place each bit of the original character in its appropriate position in the 11-bit unit.
Calculate the even parities for the various bit combination.
The parity value for each combination is the value of the corresponding r bit
For example,
The value of r1 is calculated to provide even parity for a combination of bits 3,5,7,9
and 11.
The value of r2 is calculated to provide even parity with bits 3, 6, 7, 10 and 11.
The value of r3 is calculated to provide even parity with bits 4,5,6 and 7.
The value of r4 is calculated to provide even parity with bits 8,9,10 and 11.
Now imagine the received data has 7th bit changed from 1 to 0.
Single-bit error
The receiver takes the transmission and recalculates four new data using the same set of bits
used by the sender plus the relevant parity (r) bit for each set.
Error detection
40
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Then it assembles the new parity values into a binary number in order of r position
(r8,r4,r2,r1).
This step gives us the binary number 0111(7 in decimal) which is the precise location of
the bit in error.
Once the bit is identified, the receiver can reverse its value and correct the error.
Hamming Distance
One of the central concepts in coding for error control is the idea of the Hamming
distance.
The Hamming distance between two words (of the same size) is the number of
differences between the corresponding bits. The Hamming distance between two words x
and y is d(x, y).
The Hamming distance can be found by applying the XOR operation on the two words
and count the number of 1’s in the result.
In a set of words, the minimum Hamming distance is the smallest Hamming distance
between all possible pairs. We use dmin to define the minimum Hamming distance in a
coding scheme.
UNIVERSITY QUESTIONS
41
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
1. What is meant by framing (Q.NO 44)
2. Define hamming distance (Q.NO 50)
16 MARKS
1. Discuss the issues in the data link layer (16) (Q.NO 9)
2. Explain in detail the error detecting codes (16) (Q.NO 10)
2 MARKS
1. What do you mean by error control?(Q.NO 34)
2. Define flow control (Q.NO 27)
16 MARKS
1. Discuss in detail about Internet Architecture (16) (Q.NO 6)
2. What is the need for error detection? Explain with typical examples. Explain methods
used for error detection and error correction (16) (Q.NO 10 & 13)
2 MARKS
1. State the issues of data link layer (Q.NO 37)
2. Define the term protocol (Q.NO 45)
16 MARKS
1. Draw the OSI network architecture and explain the functionalities of every layer in detail (16)
(Q.NO 5)
2. Explain the various flow control mechanisms (16) (Q.NO 11)
16 MARKS
1. Explain any two error detection mechanism in detail (16) (Q.NO 10)
2. Explain in detail about HDLC & PPP (8+8) (Q.NO 9)
2 MARKS
1. List the services provided by data link layer (Q.NO 37)
2. Write the mechanism of stop and wait flow control (Q.NO 46)
42
PREPARED BY: Mr. D. Ramkumar - A.P-CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
16 MARKS
1. Draw the OSI network architecture and explain the functionalities of every layer in detail (16)
(Q.NO 5)
2. a)Discuss in detail about the network performance measures (8) (Q.NO 8)
b) Explain selective-repeat ARQ flow control method.(8) (Q.NO 11)
44
PREPARED BY: Mr. D. Ramkumar - A.P-CSE