Vous êtes sur la page 1sur 39

III YEAR / V SEMESTER (INFORMATION TECHNOLOGY)

CS6551 – COMPUTER NETWORKS


UNIT - I FUNDAMENTALS & LINK LAYER

PREPARED BY
M.RANJITHKUMAR M.E., (AP/IT)

VERIFIED BY

HOD PRINCIPAL CORRESPONDENT

SENGUNTHAR COLLEGE OF ENGINEERING – TIRUCHENGODE

DEPARTMENT OF INFORMATION TECHNOLOGY

1
CREDIT POINT

ANNA UNIVERSITY, CHENNAI

AFFILIATED INSTITUTIONS

R - 2013

B.Tech - INFORMATION TECHNOLOGY

Code Subject L T P C
CS6551 Computer Networks 3 0 0 3
IT6501 Graphics and Multimedia 3 0 0 3
CS6502 Object Oriented Analysis and Design 3 0 0 3
IT6502 Digital Signal Processing 3 1 0 4
IT6503 Web Programming 3 1 0 4
EC6801 Wireless Communication 3 0 0 3
IT6511 Networks Lab 0 0 3 2
IT6512 Web Programming Lab 0 0 3 2
IT6513 Case Tools Lab 0 0 3 2
Total 18 2 9 26

2
SYLLABUS
CS6551 COMPUTER NETWORKS LTPC 3003

UNIT I FUNDAMENTALS & LINK LAYER 9


Building a network – Requirements - Layering and protocols - Internet Architecture –
Network software – Performance; Link layer Services - Framing - Error Detection - Flow control

UNIT II MEDIA ACCESS & INTERNETWORKING 9


Media access control - Ethernet (802.3) - Wireless LANs – 802.11 – Bluetooth - Switching and
bridging – Basic Internetworking (IP, CIDR, ARP, DHCP, ICMP)

UNIT III ROUTING 9


Routing (RIP, OSPF, metrics) – Switch basics – Global Internet (Areas, BGP, IPv6), Multicast –
addresses – multicast routing (DVMRP, PIM)

UNIT IV TRANSPORT LAYER 9


Overview of Transport layer - UDP - Reliable byte stream (TCP) - Connection management -
Flow control - Retransmission – TCP Congestion control - Congestion avoidance (DECbit, RED)
– QoS – Application requirements

UNIT V APPLICATION LAYER 9


Traditional applications -Electronic Mail (SMTP, POP3, IMAP, MIME) – HTTP – Web Services –
DNS - SNMP
TOTAL: 45 PERIODS

TEXTBOOKS:
1. Larry L. Peterson, Bruce S. Davie, “Computer Networks: A systems approach”, Fifth Edition,
Morgan Kaufmann Publishers, 2011.

LIST OF IMPORTANT QUESTIOINS


UNIT I

3
FUNDAMENTALS & LINK LAYER
PART A
1. What do you mean by error control? (May/June 2015)
2. Define Flow control. (May/June 2015, May/June 2016)
3. State the issues of data link layer. (Nov/Dec 2015)
4. Define protocol. (Nov/Dec 2015)
5. Write the parameters used to measure network performance? (May/June 2016)
6. List the services provided by data link layer. (Nov/Dec 2016)
7. Write the mechanism of stop and wait protocol. (Nov/Dec 2016)
8. Distinguish between packet switched network and circuit switched network.
(May/June 2017,April/May 2017)
9. Define Bit stuffing. Give an example. (May/June 2017, April/May 2017)
10. What are the functions of application layer? (May/June 2011)
11. What is the use of two dimensions Parity check in error detection? (Nov/Dec 2012)
12. What is the difference between port address, logical address and physical address?
(May/June 2014)
13. What will the maximum number of frames sent but not acknowledged for a sliding
window of size n-1(n is the sequence number)? (May/June 2014)
14. Define Hamming Distance. (Nov/Dec 2014)
15. Define Layer. (Nov/Dec 2013)
16. Define the terms: Bandwidth and latency. (Nov/Dec 2017)
17. Compare Byte-oriented versus Bit- oriented protocol. (Nov/Dec 2017)
18. What is mean by data communication?
19. Why are standards needed?
20. For n devices in a network, what is the number of cable links required for a mesh and ring
topology?
21. What is the difference between a passive and an active hub?
22. Assume 6 devices are arranged in a mesh topology. How many cables are needed? How
many ports are needed for each device?

PART B
1. Discuss in detail about Internet Architecture. (May/June 2015)
2. What is the need for error detection? Explain with typical examples. Explain methods
used for error detection and correction? (May/June 2015)
3. Draw the OSI network architecture and explain the functionalities of every layer in detail.
(Nov/Dec 2015, Nov/Dec 2016, Nov/Dec 2017)
4. Explain the various flow control mechanism. (Nov/Dec 2015)
5. Explain in detail HDLC. (May/June 2016)

4
6. Explain in detail PPP. (May/June 2016)
7. Discuss in detail about the network performance measures. (Nov/Dec 2016)
8. Explain Selective Repeat ARQ flow control method. (Nov/Dec 2016)
9. Explain the challenges faced in Building a network. (May/June 2017, Nov/Dec 2017)
10. Obtain the 4-bit CRC code for the data bit sequence 10011011100 using polynomial
X4+X2+1. (May/June 2017)
11. Consider a baseband bus with a number of equally spaced stations with a data rate of 10 Mbps
and a bus length of 1 km. a. What is the mean time to send a frame of 1000 bits to another
station, measured from the beginning of transmission to the end of reception? Assume a
propagation speed of Assume a mean distance between stations of 0.375 km. This is an
approximation based on the following observation. For a station on one end, the average
distance to any other station is 0.5 km. For a station in the center, the average distance is 0.25
km. With this assumption, the time to send equals transmission time plus propagation time.
(May./June 2017)

PART A
1. What do you mean by error control? (May/June 2015)
Network is responsible for transmission of data from one device to another device. The end
to end transfer of data from a transmitting application to a receiving application involves
many steps, each subject to error. With the error control process, we can be confident that
the transmitted and received data are identical. Data can be corrupted during transmission.
For reliable communication, error must be detected and corrected.
Error control is the process of detecting and correcting both the bit level and packet level
errors.

2. Define Flow control. (May/June 2015, May/June 2016)


Flow control is the management of data flow between computers or devices or between
nodes in a network so that the data can be handled at an efficient pace. Too much data

5
arriving before a device can handle it causes data overflow, meaning the data is either lost
or must be retransmitted.

3. State the issues of data link layer. (Nov/Dec 2015)


o Provide interface to the network layer services
o Framing
o Flow control
o Error control
o Synchronization
o Link Configuration Control

4. Define protocol. (Nov/Dec 2015)


A protocol is the special set of rules that end points in a telecommunication connection use
when they communicate. Protocols specify interactions between the communicating
entities.

5. Write the parameters used to measure network performance? (May/June 2016)


Bandwidth
Throughput
Latency
Jitter
Error rate
6. List the services provided by data link layer. (Nov/Dec 2016)
Framing and link access
Reliable delivery
Flow control
Error detection
Error correction
Half-Duplex and Full-Dulpex

7. Write the mechanism of stop and wait protocol. (Nov/Dec 2016)

6
 In this method of flow control, the sender sends a single frame to receiver & waits for
an acknowledgment.
 The next frame is sent by sender only when acknowledgement of previous frame is
received.
 This process of sending a frame & waiting for an acknowledgment continues as long
as the sender has data to send.
 To end up the transmission sender transmits end of transmission (EOT) frame.

8. Distinguish between packet switched network and circuit switched network.


(May/June 2017,April/May 2017)

9. Define Bit stuffing. Give an example. (May/June 2017, April/May 2017)


Bit stuffing is the process of inserting noninformation bits into data to break up bit patterns to
affect the synchronous transmission of information. It is widely used in network and
communication protocols, in which bit stuffing is a required part of the transmission process.
Bit stuffing is commonly used to bring bit streams up to a common transmission rate or to fill
frames. Bit stuffing is also used for run-length limited coding.

10. What are the functions of application layer? (May/June 2011)


The application layer is the top-most layer of OSI model. It provides services directly to user
applications. It enables them to access the network. It provides user interfaces and support
for services such as email, remote file access and transfer, shared database management
and other types of distributed information services.
File Transfer: It allows a user to access, retrieve and manage files in a remote computer.
Mail services: It provides the basis for email forwarding and storage facilities.
Directory services: It provides distributes database sources and access for global
information about various objects and services.

7
11. What is the use of two dimensions Parity check in error detection? (Nov/Dec 2012)
Using multiple redundancies is expensive. Can we adapt the idea of parity bits (which was
cheaper) to not only detect but correct errors? Suppose we arrange the stream of bits we
want to send in a two dimensional MxN array.
Two-Dimensional Parity Check – In two-dimensional parity check, a block of bits is divided
into rows and a redundant row of bits is added to the whole block.

12. What is the difference between port address, logical address and physical address?
(May/June 2014)
Logical address the system identifies a network. After identifying the network physical
address is used to identify the host on that network. The port address is used to identify the
particular application running on the destination machine.

13. What will the maximum number of frames sent but not acknowledged for a sliding
window of size n-1(n is the sequence number)? (May/June 2014)
The maximum number of frames sent=N.

14. Define Hamming Distance. (Nov/Dec 2014)


In information theory, the Hamming distance between two strings of equal length is the
number of positions at which the corresponding symbols are different. In another way, it
measures the minimum number of substitutions required to change one string into the other,
or the minimum number of errors that could have transformed one string into the other.
A major application is in coding theory, more specifically to block codes, in which the equal-
length strings are vectors over a finite field.

15. Define Layer. (Nov/Dec 2013)


The Open System Interconnection (OSI) model defines a networking framework to
implement protocols in seven layers. Use this handy guide to compare the
different layers of the OSI model and understand how they interact with each other.

16. Define the terms : Bandwidth and latency. (Nov/Dec 2017)

Bandwidth:
Amount of data that can be transmitted per time unit ⇒ transmitted = put into the
pipe (wire)
Example: 10Mbps (10 million bits per second)
8
Latency:
Time it takes to send a message from point A to point B
Components of latency

17. Compare Byte-oriented versus Bit- oriented protocol. (Nov/Dec 2017)

Byte-oriented protocol Bit- oriented protocol


 Allows frame to contain arbitrary number of  In this method, start and end of frame are
bits and arbitrary character size. The frames are recognized with the help of flag bytes.
separated by separating flag. Each frames starts with and ends with a
 Each frame begins and ends with a special bit flag byte. Two consecutive flag bytes
pattern, 01111110 called a flag byte. When five indicate the end of one frame and start of
consecutive l's are encountered in the data, it the next one. The flag bytes used in the
automatically stuffs a '0' bit into outgoing bit figure 2 used is named as “ESC” flag
stream. byte.
 In this method, frames contain an arbitrary
number of bits and allow character codes with an  A frame delimited by flag bytes. This
arbitrary number of bits per character. In his case, framing method is only applicable in 8-
each frame starts and ends with a special bit bit character codes which are a major
pattern, 01111110. disadvantage of this method as not all
character codes use 8-bit characters e.g.
Unicode.

 Four example of byte sequences before


and after stuffing.

18. What is mean by data communication?


Data communication is the exchange of data (in the form of 1s and 0s) between two devices
via some form of transmission medium (such as a wire cable).

19. What are the three criteria necessary for an effective and efficient network?
The most important criteria are performance, reliability and 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.

20. What are the advantages of distributed processing?


Advantages of distributed processing include security/encapsulation, distributed databases,
faster problem solving, security through redundancy and collaborative processing.

21. Why are protocols needed?

9
In networks, communication occurs between the entities in different systems. Two entities
cannot just send bit streams to each other and expect to be understood. For
communication, the entities must agree on a protocol. A protocol is a set of rules that govern
data communication.

22. Why are standards needed?


Co-ordination across the nodes of a network is necessary for an efficient communication. If
there are no standards, difficulties arise. A standard provides a model or basis for
development to which everyone has agreed.

23. 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

24. What is the difference between a passive and an active hub?


An active hub contains a repeater that regenerates the received bit patterns before sending
them out. A passive hub provides a simple physical connection between the attached
devices.

25. Distinguish between peer-to-peer relationship and a primary-secondary relationship.


Peer-to-peer relationship: All the devices share the link equally.
Primary-secondary relationship: One device controls traffic and the others must transmit
through it.

26. Assume 6 devices are arranged in a mesh topology. How many cables are needed? How
many ports are needed for each device?
Number of cables=n (n-1)/2=6(6-1)/2=15
Number of ports per device=n-1=6-1=5

10
PART B
1. Discuss in detail about Internet Architecture. (May/June 2015)
With a protocol graph, explain the architecture of Internet. (May/June 2017)
Internet architecture is based on a simple idea: ask all networks want to be part of carrying
a single packet type, a specific format the IP protocol. In addition, this IP packet must carry
an address defined with sufficient generality in order to identify each computer and terminals
scattered throughout the world.

11
The user who wishes to make on this internetwork must store its data in IP packets
that are delivered to the first network to cross. This first network encapsulates the IP packet
in its own packet structure, the package A, which circulates in this form until an exit door,
where it is decapsulated so as to retrieve the IP packet. The IP address is examined to
locate, thanks to a routing algorithm, the next network to cross, and so on until arriving at
the destination terminal.
To complete the IP, the US Defense added the TCP protocol; specify the nature of
the interface with the user. This protocol further determines how to transform a stream of
bytes in an IP packet, while ensuring quality of transport this IP packet. Both protocols,
assembled under the TCP / IP abbreviation, are in the form of a layered architecture. They
correspond to the packet level and message-level reference model.
The Internet model is completed with a third layer, called the application level, which
includes different protocols on which to build Internet services. Email (SMTP), the file
transfer (FTP), the transfer of hypermedia pages, transfer of distributed databases (World
Wide Web), etc., are some of these services.

12
IP packets are independent of each other and are individually routed in the network by
interconnecting devices subnets, routers. The quality of service offered by IP is very small
and offers no detection of lost or possibility of error recovery packages.
TCP combines the functionality of message-level reference model. This is a fairly
complex protocol, which has many options for solving all packet loss problems in the lower
levels. In particular, a lost fragment can be recovered by retransmission on the stream of
bytes. TCP uses a connection-oriented mode.
The flexibility of the Internet architecture can sometimes be a default, to the extent
that global optimization of the network is carried out by sub-network subnet, by a
succession of local optimizations. This does not allow a homogeneous function in different
subnets traversed. Another important feature of this architecture is to place the entire control
system, that is to say, intelligence and control of the network, in the terminal machine
leaving virtually nothing in the network, at least in the current version, IPv4, the IP protocol.
The control intelligence is in the TCP software on the PC connected to the network.
It is the TCP protocol which takes care of sending more or fewer packets according
to network load. Precise control window the maximum number of unacknowledged
fragments that may be issued. The TCP window control increases or decreases the traffic
following the time required to complete a round trip. Over this time increases, Considering
the more congested network, and the transmission rate must decrease to counter
saturation. In return, the infrastructure cost is extremely low; no intelligence is not in the
network. The service provided by the network of networks corresponds to a quality called
best effort, which means that the network does its best to carry the traffic. In other words,
the service quality is not assured.
The new generation of IP, IPv6, introduces new features that make the nodes of the
network smarter. The new generation of routers comes with QoS management algorithms,
which allow them to provide transportation can meet time constraints or packet loss. We
expect the arrival of IPv6 for ten years, but it's still IPv4 IP that governs the world.
The reason for this is that every new need achievable with IPv6, IPv4 has been able to find
the algorithms needed to do as well.
In IPv4, each new customer is treated the same way as those already connected with
resources being distributed equitably among all users. The resource allocation policies of
telecom operator’s networks are totally different, since, on these networks, a customer who
already has a certain quality of service does not suffer any penalty because of the arrival of
a new customer. As discussed, the now advocated solution in the Internet environment is to

13
encourage customers with real-time requirements, using appropriate protocols, using
priority levels.
The IP protocol for thirty years, but remained almost confidential for twenty years
before taking off, unless its properties as a result of the failure of the protocols directly
related to the reference model, too many and often incompatible. The IP world growth
comes from the simplicity of its protocol, with very few options, and it’s free.

2. What is the need for error detection? Explain with typical examples. Explain
methods used for error detection and correction? (May/June 2015)
Explain any two error detection mechanism in detail. (May/June 2016)
Discuss the approaches used for error detection in networking.( Nov/Dec 2017)
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.

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.

14
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.
The three error detecting techniques are:
 Parity check
 Check sum algorithm
 Cyclic Redundancy Check

Parity Check
Simple parity check Only one redundant bit, called parity bit is added to every data unit so
that the total number of 1’s in unit become even (or odd)
Two Dimensional Parity
 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.

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.

Check sum algorithm


 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.
 If any transmitted data, including the checksum itself, is corrupted, then the results
will not match, so the receiver knows that an error occurred.
15
 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.

Cyclic Redundancy Check


 It uses small number of redundant bits to detect errors.
 Divisor is calculated by the polynomial functions under two conditions
a. It should not be divisible by x
b. It should be divisible by x+1

 Consider the original message as M(x) – n+1 bits


 Divisor C(x) – K bits
 Original sent message = M(x) + k-1 bits

16
Steps

 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

Eg: 100100 by 1101

Error Correction can be handled in two ways

17
1. When an error is discovered, the receiver can have the sender to retransmit the entire
data unit.

2. A receiver can use an error correcting code, which automatically correct certain errors.

Error correcting codes are more sophisticated than error-detection codes and require more
redundancy bits.

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
 To calculate the number of redundancy bit(r) required to correct a given number of
data bits (m), we must find a relationship between m and r.
 Add m bits of data with r bits. The length of the resulting code is m+r.

Data and 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

Relationship between data and redundancy bits

18
Hamming Code
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

Position of redundancy bits in Hamming code

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

19
Calculating the r values
 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.

20
Error Detection and Correction
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.

21
 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.

3. Draw the OSI network architecture and explain the functionalities of every layer in
detail. (Nov/Dec 2015, Nov/Dec 2016, Nov/Dec 2017)
The Open System Interconnection (OSI) model defines a networking framework to
implement protocols in seven layers. Use this handy guide to compare the different layers of
the OSI model and understand how they interact with each other.

The Open Systems Interconnection (OSI) model has seven layers. This article describes
and explains them, beginning with the 'lowest' in the hierarchy (the physical) and proceeding
to the 'highest' (the application). The layers are stacked this way:

 Application
 Presentation
 Session
 Transport
 Network
 Data Link
 Physical

22
t.

PHYSICAL LAYER
 The physical layer, the lowest layer of the OSI model, is concerned with the transmission
and reception of the unstructured raw bit stream over a physical medium. It describes the
electrical/optical, mechanical, and functional interfaces to the physical medium, and carries
the signals for all of the higher layers. It provides:
 Data encoding: modifies the simple digital signal pattern (1s and 0s) used by the PC to
better accommodate the characteristics of the physical medium, and to aid in bit and frame
synchronization. It determines:
 What signal state represents a binary 1
 How the receiving station knows when a "bit-time" starts
 How the receiving station delimits a frame
 Physical medium attachment, accommodating various possibilities in the medium:
23
 Will an external transceiver (MAU) be used to connect to the medium?
 How many pins do the connectors have and what is each pin used for?
 Transmission technique: determines whether the encoded bits will be transmitted by
baseband (digital) or broadband (analog) signaling.
 Physical medium transmission: transmits bits as electrical or optical signals
 appropriate for the physical medium, and determines:
 What physical medium options can be used?
 How many volts/db should be used to represent a given signal state, using a given physical
medium.

DATA LINK LAYER


The data link layer provides error-free transfer of data frames from one node to another over
the physical layer, allowing layers above it to assume virtually error-free transmission over the link.
To do this, the data link layer provides:
 Link establishment and termination: establishes and terminates the logical link between two
nodes.
 Frame traffic control: tells the transmitting node to "back-off" when no frame buffers are
available.
 Frame sequencing: transmits/receives frames sequentially.
 Frame acknowledgment: provides/expects frame acknowledgments. Detects and recovers
from errors that occur in the physical layer by retransmitting non-acknowledged frames and
handling duplicate frame receipt.
 Frame delimiting: creates and recognizes frame boundaries.
 Frame error checking: checks received frames for integrity.
 Media access management: determines when the node "has the right" to use the physical
medium.

NETWORK LAYER
The network layer controls the operation of the subnet, deciding which physical path the data
should take based on network conditions, priority of service, and other factors. It provides:
 Routing: routes frames among networks.
 Subnet traffic control: routers (network layer intermediate systems) can instruct a sending
station to "throttle back" its frame transmission when the router's buffer fills up.

24
 Frame fragmentation: if it determines that a downstream router's maximum transmission
unit (MTU) size is less than the frame size, a router can fragment a frame for transmission
and re-assembly at the destination station.
 Logical-physical address mapping: translates logical addresses, or names, into physical
addresses.
 Subnet usage accounting: has accounting functions to keep track of frames forwarded by
subnet intermediate systems, to produce billing information.

Communications Subnet
The network layer software must build headers so that the network layer software residing
in the subnet intermediate systems can recognize them and use them to route data to the
destination address.
This layer relieves the upper layers of the need to know anything about the data
transmission and intermediate switching technologies used to connect systems. It establishes,
maintains and terminates connections across the intervening communications facility (one or
several intermediate systems in the communication subnet).
In the network layer and the layers below, peer protocols exist between a node and its
immediate neighbor, but the neighbor may be a node through which data is routed, not the
destination station. The source and destination stations may be separated by many intermediate
systems.

TRANSPORT LAYER
The transport layer ensures that messages are delivered error-free, in sequence, and with
no losses or duplications. It relieves the higher layer protocols from any concern with the transfer
of data between them and their peers.
The size and complexity of a transport protocol depends on the type of service it can get
from the network layer. For a reliable network layer with virtual circuit capability, a minimal transport
layer is required. If the network layer is unreliable and/or only supports datagrams, the transport
protocol should include extensive error detection and recovery.
The transport layer provides:
 Message segmentation: accepts a message from the (session) layer above it, splits the
message into smaller units (if not already small enough), and passes the smaller units down

25
to the network layer. The transport layer at the destination station reassembles the
message.
 Message acknowledgment: provides reliable end-to-end message delivery with
acknowledgments.
 Message traffic control: tells the transmitting station to "back-off" when no message buffers
are available.
 Session multiplexing: multiplexes several message streams, or sessions onto one logical
link and keeps track of which messages belong to which sessions (see session layer).

Typically, the transport layer can accept relatively large messages, but there are strict message
size limits imposed by the network (or lower) layer. Consequently, the transport layer must break
up the messages into smaller units, or frames, prepending a header to each frame.
The transport layer header information must then include control information, such as message
start and message end flags, to enable the transport layer on the other end to recognize message
boundaries. In addition, if the lower layers do not maintain sequence, the transport header must
contain sequence information to enable the transport layer on the receiving end to get the pieces
back together in the right order before handing the received message up to the layer above.

End-to-end layers
Unlike the lower "subnet" layers whose protocol is between immediately adjacent nodes, the
transport layer and the layers above are true "source to destination" or end-to-end layers, and are
not concerned with the details of the underlying communications facility. Transport layer software
(and software above it) on the source station carries on a conversation with similar software on the
destination station by using message headers and control messages.

SESSION LAYER
The session layer allows session establishment between processes running on different stations. It
provides:
 Session establishment, maintenance and termination: allows two application processes on
different machines to establish, use and terminate a connection, called a session.
 Session support: performs the functions that allow these processes to communicate over
the network, performing security, name recognition, logging, and so on.

26
PRESENTATION LAYER
The presentation layer formats the data to be presented to the application layer. It can be
viewed as the translator for the network. This layer may translate data from a format used by the
application layer into a common format at the sending station, and then translate the common
format to a format known to the application layer at the receiving station.
The presentation layer provides:
 Character code translation: for example, ASCII to EBCDIC.
 Data conversion: bit order, CR-CR/LF, integer-floating point, and so on.
 Data compression: reduces the number of bits that need to be transmitted on the network.
 Data encryption: encrypt data for security purposes. For example, password encryption.

APPLICATION LAYER
The application layer serves as the window for users and application processes to access
network services. This layer contains a variety of commonly needed functions:
 Resource sharing and device redirection
 Remote file access
 Remote printer access
 Inter-process communication
 Network management
 Directory services
 Electronic messaging (such as mail)
 Network virtual terminals

4. Explain the various flow control mechanism. (Nov/Dec 2015)


 Control is a set of procedures that tells the sender how much data it can transmit before it
must wait for an acknowledgment from the receiver.
 It prevents a fast sender from overwhelming a slow receiver with frames.

Define acknowledgement.
 An acknowledgment (ACK) is a small control frame that a protocol sends back to the sender
acknowledging the receipt of a frame.
 Frames are delivered in a reliable manner using acknowledgement

What is automatic repeat request?


 When a corrupt frame arrives at the receiver, it is discarded.

27
 If the sender does not receive an acknowledgment within a specified period (timeout), it
retransmits the original frame. This is known as automatic repeat request (ARQ).
 The two ARQ are Stop and Wait ARQ and Sliding Window ARQ

Stop and Wait ARQ


 The sender keeps a copy of the frame and then transmits it.
 The sender waits for an acknowledgment before transmitting the next frame.
 If acknowledgment does not arrive before timeout, the sender retransmits the frame.

Scenarios
a) ACK is received before the timer expires. The sender sends the next frame.
b) The frame gets lost in transmission. Sender eventually times out and retransmits
frame.
c) ACK frame gets lost. The sender eventually times out and retransmits the frame.
d) The sender times out soon before ACK arrives and retransmits the frame.
Sequence number

28
 In scenarios (c) and (d), since the receiver has acknowledged the received
frame, it treats the arriving frame as the next one. This leads to duplicate
frames.
 To address duplicate frames, the header for a stop-and-wait protocol includes
a 1-bit sequence number (0 or 1) based on modulo-2 arithmetic.

Drawbacks
 It allows the sender to have only one outstanding frame on the link at a time
 Inefficient if the channel has a large bandwidth and the round-trip delay is
long.

Operations
1. Sender: Transmits a single frame at a time(TTL).
2. Receiver: Transmits acknowledgement (ACK) as it receives a frame.
3. Sender and receiver ACK within time out.
4. Go to step 1.
The problem with Stop-and wait is that only one frame can be transmitted at a time, and that
often leads to inefficient transmission, because until the sender receives the ACK it cannot transmit
any new packet. During this time both the sender and the channel are unutilized. Flow control is
the mechanism that ensures the rate at which a sender is transmitting is in proportion with the
receiver’s receiving capabilities. Flow control is utilized in data communications to manage the flow
of data/packets among two different nodes, especially in cases where the sending device can send
data much faster than the receiver can digest.
If a frame or ACK is lost during transmission then it has to be transmitted again by sender. This
retransmission process is known as ARQ (automatic repeat request).
 One important aspect of data link layer is flow control.

29
 Flow control refers to a set of procedures used to restrict the amount of data the sender can
send before waiting for acknowledgement.

Stop and Wait Flow control:


 The sender has to wait for an acknowledgment of every frame that it sends.
 Only when an acknowledgment has been received is the next frame sent. This
process continues until the sender transmits an End of Transmission (EOT) frame.
 In Stop-and-Wait flow control, the receiver indicates its readiness to receive data for
each frame.

 For every frame that is sent, there needs to be an acknowledgment, which takes
a similar amount of propagation time to get back to the sender.
 Only one frame can be in transmission at a time. This leads to inefficiency if
propagation delay is much longer than the transmission delay

Advantages of Stop and Wait:


 It's simple and each frame is checked and acknowledged well.

30
Disadvantages of Stop and Wait:
 Only one frame can be in transmission at a time.
 It is inefficient, if the distance between devices is long. Reason is propagation
delay is much longer than the transmission delay.
 The time spent for waiting acknowledgements between each frame can add
significant amount to the total transmission time.

Sliding Window Flow Control:


 It works by having the sender and receiver have a “window” of frames.
 Each frame has to be numbered in relation to the sliding window. For a window
of size n, frames get a number from 0 to n - 1. Subsequent frames get a number
mod n.
 The sender can send as many frames as would fit into a window.
 The receiver, upon receiving enough frames, will respond with an
acknowledgment of all frames up to a certain point in the window. It is called
slide.
 This window can hold frames at either end and provides the upper limit on the
number of frames that can be transmitted before requiring an acknowledgement.
 For example, if n = 8, the frames are numbered 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4,
5, 6, 7, 0, 1...so on. The size of the window is (n -1) = 7.
 When the receiver sends an ACK, it includes the number of the next frame it
expects to receive. When the receiver sends an ACK containing the number 5, it
means all frames upto number 4 have been received.
 If the window size is sufficiently large the sender can continuously transmit
packets:
o If W >= (2a+1), sender can transmit continuously. (Efficiency =1)
o If W < (2a+1), sender can transmit W frames every (2a+1) time
units. (Efficiency = W/(1+2a) )

5. Explain in detail HDLC. (May/June 2016)


In this, frames are viewed as collection of bits. High level data link protocol is used.
The format is

 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
31
 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: If it
sees a 0 (i.e., the last eight bits it has looked at are 01111110), then it is the end-
offrame marker.
 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.

6. Explain in detail PPP. (May/June 2016)


The more recent Point-to-Point Protocol (PPP). The format of PPP frame is

 The Flag field has 01111110 as starting sequence.


 The Address and Control fields usually contain default values.
 The Protocol field is used for demultiplexing.
 The frame payload size can he negotiated, but it is 1500 bytes by default
 The PPP frame format is unusual in that several of the field sizes are negotiated
rather than fixed.
 Negotiation is conducted by a protocol called LCP (Link Control Protocol).
 LCP sends control messages encapsulated in PPP frames—such messages are
denoted by an LCP identifier in the PPP Protocol.

7. Discuss in detail about the network performance measures. (Nov/Dec 2016)


Network performance refers to measures of service quality of a network as seen by the
customer.
There are many different ways to measure the performance of a network, as each network
is different in nature and design. Performance can also be modeled and simulated instead of

32
measured; one example of this is using state transition diagrams to model queuing
performance or to use a Network Simulator.

The following measures are often considered important:


 Bandwidth commonly measured in bits/second is the maximum rate that information can
be transferred
 Throughput is the actual rate that information is transferred
 Latency the delay between the sender and the receiver decoding it, this is mainly a function
of the signals travel time, and processing time at any nodes the information traverses
 Jitter variation in packet delay at the receiver of the information
 Error rate the number of corrupted bits expressed as a percentage or fraction of the total
sent

8. Explain Selective Repeat ARQ flow control method. (Nov/Dec 2016)


Selective Repeat ARQ overcomes the limitations of Go-Back-N by adding two new features:
 Receiver window > 1 frame: Out-of-order but error-free frames can be accepted
 Retransmission mechanism is modified: Only individual frames are retransmitted
 In this method, only specific damaged or lost frame is retransmitted
 Sender only retransmits frames for which a NAK is received.
 NAK number refers to the frame lost.
 If a frame is corrupted in transmit, a NAK is returned and the frame is resent out
of sequence.
 The sender needs to maintain all data that hasn’t been aknowledged yet.
 The receiving device must be able to sort the frames it has and insert the
retransmitted frame into its proper place in the sequence.
 It has advantage that few re-transmissions than go-back-n. But complexity at
sender and receiver is involved.

Example: Frame 2 has an error, so receiver maintains buffer to store the next frames.

33
Damaged frames:
 In Selective reject, If a receiver receives a damaged frame, it sends the NAK for the

frame in which error or damage is detected.


 The NAK number, like in go-back-n also indicate the acknowledgement of the
previously received frames and error in the current frame.
 The receiver keeps receiving the new frames while waiting for the damaged frame to
be replaced.
 The frames that are received after the damaged frame are not be acknowledged until
the damaged frame has been replaced.

Lost Frame:
 As in a selective repeat protocol, a frame can be received out of order and further

they are sorted to maintain a proper sequence of the frames.


 While sorting, if a frame number is skipped, the receiver recognise that a frame is lost
and it sends NAK for that frame to the sender.
 After receiving NAK for the lost frame the sender searches that frame in its window
and retransmits that frame.
 If the last transmitted frame is lost then receiver does not respond and this silence is
a negative acknowledgement for the sender.

Lost Acknowledgement:
 In Selective reject, If the sender does not receive any ACK or the ACK is lost or

damaged in between the transmission.


 The sender waits for the time to run out and as the time run outs, the sender
retransmit all the frames for which it has not received the ACK.
 The sender identifies the loss of ACK with the help of a timer.

34
9. Explain the challenges faced in Building a network. (May/June 2017, Nov/Dec 2017)
The main objective of the network layer is to allow end systems, connected to
different networks, to exchange information through intermediate systems called router.
The unit of information in the network layer is called a packet.

Before explaining the network layer in detail, it is useful to remember the


characteristics of the service provided by the datalink layer. There are many variants of the
datalink layer. Some provide a reliable service while others do not provide any guarantee of
delivery. The reliable datalink layer services are popular in environments such as wireless
networks were transmission errors are frequent. On the other hand, unreliable services are
usually used when the physical layer provides an almost reliable service (i.e. only a
35
negligible fraction of the frames are affected by transmission errors). Such almost
reliable services are frequently in wired and optical networks. In this chapter, we will assume
that the datalink layer service provides an almost reliable service since this is both the most
general one and also the most widely deployed one.

To send one byte of information to host B, host A needs to place this information
inside a packet. In addition to the data being transmitted, the packet must also contain
either the addresses of the source and the destination nodes or information that indicates
the path that needs to be followed to reach the destination.
There are two possible organisations for the network layer :
 datagram
 virtual circuits

10. Obtain the 4-bit CRC code for the data bit sequence 10011011100 using polynomial
X4+X2+1. (May/June 2017)

11. Consider a baseband bus with a number of equally spaced stations with a data rate of 10 Mbps
and a bus length of 1 km. a. What is the mean time to send a frame of 1000 bits to another station,

36
measured from the beginning of transmission to the end of reception? Assume a propagation speed
of Assume a mean distance between stations of 0.375 km. This is an approximation based on the
following observation. For a station on one end, the average distance to any other station is 0.5 km.
For a station in the center, the average distance is 0.25 km. With this assumption, the time to send
equals transmission time plus propagation time.(May./June 2017)
T = (10^3 bits / 10^7 bps) + (375 m / 200 ×106 m / sec)= 102µ sec

a. What is the mean time to send a frame of 1000 bits to another Station, measured from
the beginning of transmission to the end of reception? Assume a propagation speed of 200
m/microsec.
We asume that the distance between two stations is 500M
a) Mean time to send = propogation time + transmission time
= 500m. / 200msec. + 1000bits / 10 000 000 bps.
= 2.5 msec. + 100 msec. = 102.5 msec.

b. If two stations begin to transmit at exactly the same time, their frames will interfere
with each other. If each transmitting stain monitors the bus during transmission, how long
before it notices an interference, in seconds? In bit times?
b) If the two stations begin the transmission at exactly the same time the signal will interface
after exactly 250m.
Tinterface = (250m + 250m) / 200m/msec = 2.5 msec

a) 1-km, 10-Mbps baseband bus?

Slot Time = Transmission Time and Propagation Time


Transmission Time = (Number of bits / Rate)
Propagation Rate = 200,000,000 m / Second
Slot Rate = 1 / slot time = 100 bits per slot

Propagation Time = (10^4 / 2)(10^8) = 50 µs propagation delay


Transmission Time = (100 bps/10,000,000 bps) = 10 µs
Slot Time = 10µ seconds + 50 µ seconds = 60 µs
Slot Rate = (1 / .00006) = 16,666.7
Data Rate = (1,000 x 16,666.7) = 16666700Mbps
Rate calculation for number of stations = (16,666,700 / N)

b) A 10-Mbps ring with a total length of 1 km?

The duration of one bit delay = {(1 bit/ T seconds)=(10,000,000 bits / 1 second )},
therefore, T= 0.1ms
So, one bit delay is imposed by (N+2) x 0.1 ms.
37
The propagation delay = 2d x (20ms/km) = (2x10) x (20ms/km) = 0.4 seconds or 400 ms.

But per the question, we need to use (2 x 10^8 m/s) for the propagation delay.
Transmission Time= {(100 bit/t seconds) = (10,000,000 bits / 1 second)} Therefore, t = 10
ms
Each 100-bit packets requires 10ms+(2 x 10^8)+(N+2) x 0.1 ms

c) A 10-Mbps ring with a length of 0.1 km between repeaters?

The duration of one bit delay = {(1 bit/ T seconds)=(10,000,000 bits / 1 second )},
therefore, T= 0.1ms
So, one bit delay is imposed by (N+2) x 0.1 ms.
The propagation delay = 2d x (20ms/km) = (2x0.1) x (20ms/km) = 0.004 seconds or 4 ms.

But per the question, we need to use (2 x 10^8 m/s) for the propagation delay.
Transmission Time= {(100 bit/t seconds) = (10,000,000 bits / 1 second)} Therefore, t = 10
ms
Each 100-bit packets requires 10ms+(2 x 10^8)+(N+2) x 0.1 ms

d) Compute the throughput for parts a, b, and c for 10 and 100 stations.

Compute the throughput for a, b, and c for 10 and 100 stations.


Throughput for 10 Stations
Throughput for 100 Stations
16,666,700 / N Where N = 10
16,666,700 / N Where N = 100
16,666,700 / 10
16,666,700 / 100
Throughput = XXXXXXX Kbps
Throughput = 166667 Kbps

Assume a mean distance between stations of 0.375 km. This is an approximation based
on the following observation. For a station on one end, the average distance to any other
station is 0.5 km. For a station in the center, the average distance is 0.25 km. With this
assumption, the time to send equals transmission time plus propagation time.

3
10 bits 375 m = 102µ
T= + sec
7 6
10 bps 200 × 10 m sec

375 m
T = 6
interfere 200 × 10 m sec = 1.875µ sec
7 −6
T interfere (bit −times) = 10 × 1.875 × 10 = 18.75 bit − times
38
39