Vous êtes sur la page 1sur 41


Introduction – Layers 1 and 2
Building a network – requirements – network architecture – OSI – Internet –
Direct link networks – hardware building blocks – framing – error detection
– reliable transmission

The purpose of this course is to understand the behavior or working of networks
as they are today, and use this knowledge to build or design computer networks.
To this end, we study the existing network architectures, their requirements, their
performance & their issues - solved and yet to be solved. This unit introduces
some basic concepts of simple networking.

This unit is organized into 4 chapters, and each chapter is organized into a
number of lessons as outlined below.

Structure of the unit
1. Introduction
1.1 Networking – What ? Why? & How?
1.2 Requirements
2. Network Architecture
2.1 Layering and protocols
2.2 OSI Architecture
2.3 TCP/IP
3. The Physical connection
3.1 The links
4. The logical connection – Data Link
4.1 Framing
4.1.1 Bit-oriented framing
4.1.2 Byte-oriented framing
4.1.3 Clock-based framing
4.2 Flow control
4.2.1 Stop and wait flow control
4.2.2 Sliding window flow control
4.3. Error control
4.3.1 Parity check
4.3.2 CRC

4.3.3 ARQ mechanisms

Learning Objectives

On completion of this unit you should be able to
• Identify the requirements of a network.
• Understand the concept of layering.
• Specify the layers in the OSI and TCP/IP architecture.
• Identify the functionality of each layer.
• Get an idea of how networks are physically connected.
• Understand the functionalities of the logical link.
• Discuss various framing, flow control and error control schemes.


In this chapter we identify the need for a network, and the complexity in building
networks. Lessons in this chapter:

1..1 Networking – what ? Why? & How?
1.2 Requirements

Lesson 1.1 Networking –What? Why? & How?

Let us ponder over these questions. Even a child/novice who has some exposure
to computers would know “what” a network is. A simplistic definition of “an
interconnection of different machines” would suffice to start with.

The question of “Why Networking” has been rendered meaningless in today’s
context, due to the ubiquitous ‘Internet’ and the world - wide web. It would
amount to stating the obvious. Everybody today needs the Internet and the
World-wide-web – to get information on any topic, to book tickets, to send mail to
one another, to watch movies, to listen to music, to play games, and the list goes
on. And, all this happens because of the underlying network.

It is interesting to take a look at some of the developments that have lead to the
current situation and some of the present and proposed applications. That is,
how things have been happening, what is actually being done, and what is likely
to happen in the future. This is more or less the goal of this course.

In general, one can see that the enhancement of network facilities and the
demand of applications have had a mutually contributing effect. On the one hand,
facilities are enhanced to meet the demand of applications; on the other,
enhanced facilities enable one to envisage applications that make use of the
available facilities. For instance, initial networks were used only by universities to
share information among them. Then, these networks were made accessible to
people outside of these universities, and with that came a requirement of sending
/ sharing data and voice among users. And also more data, which meant more,
speed. An associated development therefore was the design of special networks
such as integrated services network and the high-speed ATM networks that can
handle more data and voice at higher speeds. With the kind of bandwidths that
these networks can support, demanding applications like, video on demand,
streaming of audio and video, interactive gaming etc., are being pursued.

Looking at the application scene of today, a number of popular applications exist.
FTP or file Transfer Protocol- still continues to be one of the most useful
applications. The World Wide Web of course, would win - hands down. Audio
and video conferencing is another that has become popular. E-mail and
newsgroups have become part of day-to-day activities, and e-commerce and its
cousin – web services is the mantra today. And all these depend on a robust
network to be really meaningful.
So we’ll try to take a look at what all these things mean from a networking

As we go through this course, we will look at the technology, techniques,
architecture, protocols - hardware and software that should give you an
understanding of how all of this really works.

Lesson 1.2 Requirements

But, before trying to understand how these networks operate to support the
different applications, it is necessary and useful to understand the requirements
or specifications - both mandatory and desired, that it should meet. Further, this
list of requirements should incorporate the perspectives of the user and the
designer. In addition, it should also take into account the needs of the network
provider- the one who provides the services to the users.

In order to understand the specifications/ requirements of a network, let us start
with building a small network. The smallest network that we can think of is a two-
machine network. Think of the many ways in which you can connect up two
machines to form a network. What do we need ? We need a physical media – a
copper wire, an optical cable, or a wireless connection to physically transfer the
data from one machine to another.

We need to have a transmitter on one machine that will send data and a receiver
on the other that will receive the data. The transmitter and receiver should talk
the same language – in terms of how or in what format they are actually
exchanging data. That is , the data must first be put in some format that the
transmitter and receiver have agreed upon, and then sent, again at a mutually
agreed upon rate, using the physical media.

A very simple example of such a network would be an interconnection of two
machines through a serial port by means of a serial cable. An application
program running on one machine can then talk to a program running on the other
by writing to the serial port and reading from it. The only requirement would be
that both the serial ports be configured to support the same data format, and data

Let us expand this network a little further. Let us connect 3 machines to form a
network. At the physical level, we need to look at how three machines may be
interconnected. Its simple ! – Every machine connects to the other two using two
separate links. All machines are fully connected to one another (fig. 1.1). The
rest of the communication is like a two machine set up.

Fig.1.1 Three machines connected to each other through separate links

Now expand to more than 3 machines, some value ‘n’. Look at the
interconnection options –
(i) a fully connected network as in the 3 machine set-up. We need n-1
connections for each machine.
(ii) A ring structure, where each node has two connections to its left and
right neighbours – and they join hands to form a ring (fig.1.2a).
(iii) A star structure – where there is one central node to which all
machines connect, and they communicate to one another through that
node etc (fig 1.2b).
These structures are called topologies in the networking world.

. A ring. we need the reverse function – demultiplexing. would work in a manner similar to our 2-machine network. star or bus network (we will look at these in detail later). and sometimes need the cooperation of other nodes to send data.Fig. many inputs are the nodes that need to send data. At the other end of the channel. on the other hand. Here. We need access mechanisms to determine who gets access to the cable at any given point of time – what we refer to as “media access control”.2 Topologies . the data coming on the channel (input) is sent to one of many machines (output). where. The concept of multiplexing is something that we are already familiar with – many inputs sharing a common output. but require more than one node to share the cable.a) Ring b) Star A fully connected network. and the output is the channel itself. It can become costly. since there is a point-to-point (dedicated) link between every pair of nodes. This implies that there should be some mechanism for such sharing and co- ordination. 1. would require less wire. This access control mechanism can actually be viewed as some kind of multiplexing. The main disadvantage of this network is that a lot of wire is required to establish the network.

(iii) Media access control techniques (iv) Applications that will use this infrastructure to communicate. Switching mechanisms commonly used are circuit-switching or packet switching or some variation of these.. So. We will not worry about the techniques now. We need (i) some physical media that determines the basic rate at which data can be transferred. Let us pause this discussion here. you send a message that is then delivered offline to the destination. wavelength etc. or have separate networks at different locations and interconnect them. ‘from where’ ‘to whom’ ! That is we will need additional devices called switches or routers that allow such extensions or interconnections. (ii) to choose a suitable topology for the network along with any additional hardware devices. Packet switching is like your SMS. there can be many applications on one machine that need to share this infrastructure. and consolidate the requirements for our network. in terms of frequency. .Understand the concept of mux and demux intuitively. This implies that we first need some interconnection mechanism to connect various networks. we may add more machines to the same network if they are to be located near-by (say same department or floor). we need some mux-demux mechanisms on each node that allow such sharing to happen (fig. to what distance etc. We will understand them better when we come to the actual places where they are used. If we want to expand our network even further. It can also be done on an ad hoc or on-demand basis. and then a routing mechanism to determine how to send data from a node on one network to another node on another network. This will require what are called switching mechanisms and addressing mechanisms. once again. giving rise to frequency division multiplexing (FDM).3). Addressing mechanism is needed to identify ‘who’ is sending. This mux-demux operation can be done by sharing the channel in terms of time – time-sharing or time-division multiplexing. 1. wavelength division multiplexing (WDM) and so on. Once we have all this infrastructure. Circuit switching is something we use in telephone networks – where an end-to-end path is established before communication takes place. We will keep referring to this idea again and again at various places.

1. Let us just spend a few minutes on what we actually mean by performance in this context. Yet another question is how scalable is the network – meaning – how many more machines/ networks can be connected without affecting performance. and maximize the latter. delay – how long does it take. Two contradicting goals which actually lead to some interesting challenges and trade-offs in the design of networks.Fig. All three are important. Just think of the network applications that you commonly use. Ideally. and try to figure out which of these parameters are critical for each of them. The terms used commonly are throughput – how much data is transferred per unit of time. we would like to minimize the former. and reliability – how reliable is the service given that failures will occur. . Some more important than the others – depending on the application.3 Mux – Demux Structure And while we construct a network with all these features. two main questions will arise – what is the cost ? and what is the performance ? These are two very pertinent questions.

What is meant by multiplexing / demultiplexing operation in the networking domain? Try these : 1. (v) Reliability. these requirements can be categorised into the following: (i) Connectivity (ii) scalability. How to build a small network ? 3. Name a few components that you need to purchase to setup a LAN for a small office. So. Why is networking important ? 2. (vi) Performance. What are the requirements of a network ? 4. What is meant by topology of a network ? 5. How would you calculate the cost of setting up a network? 2. the question is – how do we actually go about designing these networks ? What has been done and why ? These are what we try to answer as we go on. . Have you understood ? 1.Broadly. (iii) Cost-effectiveness (iv) Functionality.

Referring to the discussion in the previous section. and to the one below it – to use its services.3 TCP/IP. which is on top of a physical layer. 2.2 OSI Architecture. our simple two machine network can be composed of two layers on each machine – an application layer on top of a physical connectivity layer provided by the serial interface.e. i. each layer will have a peer- interface which defines how this layer interacts with the corresponding layer on a remote machine. The idea is that an application need not worry about all the details of all the functions performed by the network. Layering can be viewed as different levels of abstraction of the network’s services. Also.1 Layering and protocols.1 LAYERING AND PROTOCOLS Layering is a concept that is common to both the models to be discussed here. Each layer performs its defined set of functions and provides certain services to the layer above it. network designers have developed a ‘Network architecture’ that is used to design and implement networks. 2. CHAPTER 2 NETWORK ARCHITECTURE To handle the complex requirements outlined in the previous lesson.. We’ll first look at some of the general fundamentals of these. as a composition of application layer on top of a media access layer. So we’ll look at that first. Each layer will have an interface – a service interface – through which the layer above it can access its services. Lessons in this chapter 2. the different services provided by the network can be abstracted at different levels. before addressing each separately. There are two models that are prevalent. It needs to interface only with the top most layer. Each abstraction would roughly correspond to a layer. each layer needs to interface only with 2 layers – the one above it – to provide some services. . The ‘n’ machine network.the OSI model and the TCP/IP model. Lesson 2. Similarly.

1 Advantages of layering: (i) Problem decomposed into manageable components. Now let us look at what we mean by a protocol. 2.1. • In essence.2 What is a protocol? • A protocol gives the how. 2.  Can conveniently change any layer or its functions without affecting the others. (ii) Modular approach. the complex task of networking is broken down into more manageable pieces that work together giving rise to the idea of a layered network architecture.  Need not write one huge monolithic piece of s/w. what & when of the communication that takes place between 2 entities. By combining these two concepts – of layering and the use of protocols. it gives the  Syntax à How?  Semantics à What? and   Timings à When? of the data being exchanged between the two entities. We next look at the salient features of these two architectures.2 OSI Model The OSI Architecture is a standard proposed by ISO. many years ago – in 1983.2.1). The two entities here could be two adjacent layers in the tiered/layered approach or the two peer layers in each node that are communicating with one another. Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer .1. (iii) Flexibility. Two such network architectures are in vogue .the OSI Architecture and the TCP/IP Architecture. Lesson 2. This network architecture divides the network functionality into 7 layers as shown below (fig.

The data link layer which sits just above the physical layer is responsible for making some sense out of the raw bits that are sent to and received from the physical layer. flow . then this needs to be identified and some action needs to be taken. A fast sender should not overwhelm a slow receiver. This layer therefore deals with questions like – what kind of signals. deals with (relates to) the physical medium. optical etc. This layer groups the bits into some manageable size. This is referred to as error handling / control. what is the delay in transmitting and propagating the signal etc.1 Architecture as per OSI Model A few lines to consolidate the functions of each of these layers.Fig. Similarly. A group of bits at this layer is referred to as a frame. The physical layer – the bottom-most layer in the architecture.. that is actually responsible for transferring the data from one side to the other by means of signals. how to recover the signal in the presence of noise. we need to check if the receiver is able to accept the data. else we may again lose the data. and keep track of how much data has been sent or received correctly on either side. how much data can be represented by the signals. Ensuring this goes by the name of flow control. If a frame of data does not reach the other end due to some noise or error at the physical layer. how to transmit the signal. 2. This grouping is done so that we can give some identity to the data being transmitted. framing. electro- magnetic. error control. what kind of media. and store it into its buffer at the rate sent by the sender. and accordingly the media used to carry these signals would be of different characteristics. data rate for a signal rate. Thus. The signals may be electrical.

which allows many programs to share the services provided by the network layer. the bottom three layers are required at all the end machines and the intermediate routers. Other than this transport. If we are dealing with a two machine network that we discussed earlier. it has to be sent to the correct recipient application on that machine. and prevent intermittent network failure from affecting the application.e. DLL and NL). Thus we can visualize the seven layers required for the network to function. which does not have the presentation and sessions layers. once the data reaches the destination machine with the help of the network layer. there are two other distinct functions which may be required by all applications. These two functions deal with establishing a session between the two ends. whereas all seven layers would have to be present at the end machines. It assumes that the functions of these two layers can be taken care of by the applications themselves. and taking care of presentation aspects. all end machines need to have one more layer of functionality which allows data from many applications to be transported across the network. This layer located just above the DLL. we also need a multiplexing function above the network layer at the source machine. A few words on what we mean by these terms : Establishing a session helps to keep track of data being transported for a given application.control etc. the physical layer and the data link layer are the two layers that would suffice. That is. There is also a 5- layered TCP/IP model (discussed in the next section). we need a network layer to handle network-related functions. we need a demultiplexing function above the network layer at the destination machine. Of these. Thus. are functions to be handled by the data link layer. this layer is responsible for making sure that data is sent reliably across a physical network.Encapsulation: . Instead of each application individually building in these functions. PL. it may be wise to group them and provide it as a service. But if we are to deal with more machines interconnected to form a network. Now. Correspondingly. All devices such as routers/ switches must have all the functionalities up to this layer (i. are part of this layer. This is referred to as the 7-layered OSI model. The job of the presentation layer is to iron out such differences. that can be used by the applications if necessary. Mechanisms to identify a path/route to be taken from source to destination. Remember that two machines may represent the same data in different formats.. Essentially. Data flow in layered models . is responsible for routing packets across many networks/nodes. Presentation deals with “representing” the data in a format that is understood correctly by the end machines. and reach the correct application at the other end – what we call as the transport layer.

o Speed of Transmission. Data link layer : Groups the raw bits into frames and sends them. o In -order delivery.Media Access control (MAC) function. Issues include: o Multiplexing of different message channels on the network. The header contains control information that the layer wants to convey to its counter part on the receiving side – to provide some functionality. Each layer is said to encapsulate the packet it receives from the higher layer. Summary of issues in each layer Physical layer : is concerned with transmitting raw bits over a communication link. Transport Layer: An end to end protocol layer. Error free point to point delivery.Retransmission in case of error. o Physical media for transmission etc. o Should handle heterogeneous networks. It adds its own header and passes it to the next layer. These 3 lower level layers are implemented on all network nodes & switches. The reverse process takes place on the Rx side – as the data moves from the lower level layers to the application layer – and finally to the user. implemented on the network adapter. does the necessary processing. gets converted into raw bits and is transmitted. o Flow control between hosts. Issues include: o How are the bits represented. o Flow Control . This way the data travels down to the lowest layer – the physical layer on one side. Issues include: o ‘Packets’ of data are exchanged between hosts o Static or dynamic routing. o Accessing the physical media . The presentation layer treats this whole package as its data and processes it. Network Layer: concerned with routing packets from source to destination. o How are they transmitted. and passes the ‘data’ to the higher layer. Issues include: o Framing and acknowledgement handling o Error control . A message is exchanged from host to host. o Normally.making sure that a slow receiver is not flooded by a fast transmitter. .The data is presented by the user to a specific application layer protocol. Each layer removes the headers put in by its peer layer. This protocol adds its header to it and passes this on to the next layer.

Lesson 2.2): OSI TCP/IP Application Application xPresentation Session Transport Transport Net work Internet Data Link Host to Net Physical work ------------------- ---- (A single layer or two layers) Fig.check pointing to resume in case of failure.as this is the basis of the all too familiar ‘Internet’.  Applications Layer: The actual applications that really need to communicate from one system to another. This model has almost replaced the OSI model.3. 2. The TCP/IP model This is also referred to as the Internet architecture . Presentation Layer : Concerned with the format of the data exchanged between the end systems. o Abstract data structure. Examples are : FTP. o Synchronization . etc. Issues include: o Dialogue control.Sessions Layer: Allow users on different hosts to establish a session between them.2 TCP/IP Model . Or as the DOD model – as it was funded by the Department of Defense. Issues include: o Data representation standards. This is a 4 or 5 layer model – the 7 layers of OSI are collapsed into 4 or 5 as shown below (Fig 2. HTTP.

2.The Presentation and Sessions layers are done away with – the application layer is expected to handle these issues. The application directly talks to either the TCP or the UDP which in turn use IP. List the seven layers of the OSI architecture. What is the primary function of each layer ? 4. How does the data flow from one application on one machine to another application on some other machine ? . Among these 2 models. 3. Which are the missing layers in the TCP/IP model? 5. Name 2 reasons for using layered protocols. it is the TCP/IP model that has flourished. Hence the discussion in the following chapters focuses more on the TCP/IP model. The 2 key constituents of this model are the TCP and IP protocols used at the transport and network layers. This makes sense – as these 2 are normally handled together by the network adaptor card. The Transport layer also supports another protocol – the UDP. (OSI vs TCP/IP). The lowest 2 layers are combined into one in the 4 layered model. Have you understood ? 1. and they are retained as such in the 5 layer model.

and the bandwidth required (or in other words. (ii) Attenuation .1 The Links Here.in the sense that it could be a wired or wireless connection. CHAPTER – 3 THE PHYSICAL CONNECTION IN A NETWORK This chapter provides a quick brush up of the physical layer characteristics and functions.This limits the distance. Depending on the distance. The different kinds of guided media commonly used are: • Twisted pair . the data rate required). Lesson 3. .the one that is actually responsible for moving /transmitting the bits from one place to another. Some of the factors that determine these two essential parameters are: (i) Bandwidth . We will first take a look at wired networks before moving into the realm of wireless networks. the job of transferring the bits is handled at this layer. Actually a ‘physical’ connection may or may not exist.This is specially in the case of guided media. (iv) No of Receivers . higher is the data rate that can be achieved. • Coaxial Cable. • Optical Fiber. Nevertheless. we take a look at the bottom-most layer in the network architecture.Susceptibility to interference can totally wipeout the signal being transmitted.Higher the bandwidth. (iii) Interference . the physical media is chosen. Different media have different attenuation values. Each receiver could cause some attenuation thereby limiting the distance and/or data rate.Shielded twisted pair STP & Un-shieled twisted pair UTP. The date rates and the distances that different media support subject to these factors are discussed below.

Shielded – STP.Distance of up to 5 to 6 km between amplifiers Bandwidth – up to 250 KHz. o For Digital . • Limited in distance. • A number of such pairs are bundled together and wrapped in a tough protective sheath.used in LANs. o Very little loss. Adjacent pairs have different twist lengths.(2 Gbps. • The twist helps to decrease the cross-talk interference between adjacent pairs in a cable. o Base band cable – for analog – upto 400 MHZ. • Can be used to transmit both analog and digital signals. • can be used over longer distances. eg.V.Distance of 2-3 km between repeaters Bandwidth – is such that data rates up to a few Mbps for very short distances – even 100 Mbps. Optical fibre • A very thin flexible medium (made of glass/plastic) capable of conducting an optical ray. More expensive.. • Has an inner core. o Light travels due to principle of total internal reflection. o Used extensively in LANs. o For Analog . bandwidth & data-rate. • Many advantages. Telephone cable o Inexpensive o 2 categories – CAT 3 à upto 16MHZ(Voice grade) and CAT 5 à upto100 MHZ à More twists/inch. o High data rates over very long distances.) . a cladding on top and a jacket. o Laser or LED light source is used. o 2 types Unshielded – UTP à This is commonly used. Coaxial cable • 2 conductors – 1 inner wire surrounded by an outer conductor connected to GND with insulation / dielectric material between them. • Optical transmission of data.Twisted Pair This consists of 2 insulated copper wires twisted together in a regular pattern. o Broad band cable – for digital ≅ 500 bps. with repeater spacing of 1 to 10 Km. UTP: o eg. T. Cable .

What are the different types of guided media available for building networks ? 2. Infrared • Using transmitters / receivers that modulate non-coherent infrared light (LEDs or Lasers) • Line-of-sight communication – Does not cross walls à A kind of Security! • Useful in LAN scenario. Wireless Transmission Also referred to as unguided media transmission. • Problems due to interference etc. • Data rates of up to 100 Mbps. • Usually microwave antennae are located at substantial height above ground level to enable this. Uplink to satellite and down link to station (at different frequencies) with satellite acting as amplifier /repeater. What is the advantage of optical fibre ? 3.) Terrestrial Microwave • Focusses a narrow beam of signal to achieve line-of-sight Tx to receiving antenna. Microwave spectrum (GHz range) à (i)Terrestrial Microwave(point-to-point Tx. o Light weight. • Used for T. Have you understood ? 1. o Used in long haul trunks (to carry tens of thousands of voice channels). o Becoming increasingly popular. Transmission takes place in the microwave spectrum or infrared spectrum. (ii) Satellite microwave (point-to-point and broadcast Tx.V. and MANs. and long distance telephone Tx. • Used in long hand telecommunications and in short point-to-point link between buildings.(2-40 GHz)). What data rates can be achieved using the various types of media ? . Satellite Microwave • Use of satellite to link two or more ground stations. • Data rates – up to 100 Mbps.


1 Byte – oriented protocols In this set of protocols.Indicates start of text. synchronization information and so on.Indicates start of Header character STX . SOH . end of frame.Cyclic redundancy check (A code used for error detection.or atleast knowing if they have or not.Indicates synchronization information. • Error Control. so that the sender and receiver are able to identify the frames uniquely. . all other control characters are of 1 byte.Indicates end of text. But how does one manage or control this flow of bits? This is handled by the data link layer that sits just above the physical layer. The issue in framing is in determining which set of bits constitute a frame. 4. • Addressing and • Link management. • Flow Control. Chapter 4 THE LOGICAL CONNECTION – DATA LINK The physical layer transports a stream of bits. A typical example would be the BISYNC protocol whose frame format is given below. Lesson 4.1. There are several approaches to this. a frame is a collection of bytes. which is 2 bytes. At this layer. and making sure that these blocks reach the other end. This approach was used on the earliest systems. ETX . CRC . SYN SYN SOH Header STX DATA ETX CRC SYN . The issues here are : • Framing. We look at these in this lesson. Specific byte values indicate start of frame. We take a look at these in this chapter.) Other than CRC.1 FRAMING A frame is a group of bits exchanged between two nodes at the data link layer. the focus shifts to organising the stream of bits into blocks.

say. On the receiver vide.1. both the start of frame and the end of frame are denoted by a unique pattern of bits 01111110. they are not really suited for any arbitrary data. The bit-oriented protocols are more suited for that. When two frames are sent back-to-back. This technique works as follows : Whenever 5 consecutive ones are transmitted. it is preceded by another control character – the DLE character. a 0 is inserted. pixel values in an image. Can you identify the situation when these would occur? . This flag pattern is transmitted even when the link is idle to keep the clocks of the transmitter and the receiver in synchronization. Here again it is possible that this sequence appears amidst data. To avoid this. In this protocol. The danger here is-‘What happens if that field gets corrupted?’ The receiver would go on reading as many bytes. that is character stuffing) . thus signaling a premature end-of-frame. Now if the DLE character itself appears in the data stream. like. a single flag serves as the end of the first frame and the start flag of the second. called the flag. it would indicate a premature end.This system works fine as long as an ETX character pattern does not appear in the data stream. Look at the errors that can occur in this framing scheme. if this pattern occurs in the data stream. a technique called bit. Similarly. To avoid this. a zero following 5 ones is removed. it is preceded by one more DLE. think about what would happen if the ETX field in the previous approach got corrupted!! A disadvantage of byte-oriented protocols is that while they are very natural for transmission of text. (Note that – this is similar to adding a DLE character in the byte-oriented protocol.2 Bit-Oriented protocols: The common standard for bit-oriented protocol is the HDLC protocol. 4.of –frame signal to the receiver.check field) that an erroneous frame has been received. is to have a ‘byte-count’ field in the header and read-in that many bytes. If it does. standing for High-level Data Link Control protocol. or two frames could be combined into one. One frame could get split into two frames due to an error. as part of the message.stuffing is used. but would determine at the end (Using the error.! Yet another approach that can be adopted to specify the end of frame. If this is bit-stuffing.

1) : Flag Address Control Messag FCS Flag e 8 bits 8 extendable 8 or 16 bits Variable 16 or 32 bits 8 bits Address field – Identifies the transmitting/receiving station. FCS – Frame check sequence-16 bit or 32 bit CRC. later. repeated every 64µ s to give a data rate of 1. 4. Control field – Identities the type of the frame. TDM: TDM basically refers to multiple data sources sharing a common link on a time- bound basis.the T1- carrier(using TDM) and the SONET to understand this. At the receiver.as information frame or control frame.3 Clock.2 TDM format . one or more slots is dedicated to a data source. We’ll briefly look at 2 standards. the frame is de-multiplexed and routed to appropriate destination.544 Mbps.1.based framing This is a third approach to framing. each frame contains a set of time slots. In TDM.The basic HDLC frame format is as below (fig 4. The major difference from the previous 2 approaches is that here we are talking about fixed-length frames.2): Fig. Each time-slot has a fixed number of bits. say one byte. In each frame. 4.division multiplexing (TDM) may also be viewed under this catergory. Fig 4. We’ll focus on the framing aspects alone. Data from each of the sources are interleaved to form the TDM frame. The frame format would be as follows (fig 4.1 HDLC frame format We’ll look into other details of HDLC. and the clocks at the 2 ends are synchronized. An example TDM The T1 carrier uses a frame with 193 bits-24 channels of 8 bits each + 1 control bit. Time.

2 Flow Control Flow control is to ensure that the sending station does not send frames at a rate faster than what can be handled by the receiving station.normally depicted as 9 rows X 90 columns as shown in the figure (fig 4. This is provided by the control bit attached to each frame. the receiver allocates some buffer of a certain maximum length for the data. which runs at 51. The STS- SONET frame is of a fixed length of 810 bytes. 4. However. What ever link control is required by the individual stations is provided on a per channel basis. So the receiver looks for this sequence in consecutive frames to establish synchronization. But how is the start of frame identified? – By the first 2 bytes of the frame. Normally.84 Mbps.No explicit datalink control mechanisms are needed at the frame level. Fig. Let us look at the lowest speed link.3 Outline of SONET frame format So that fixes the length of the frame. Here again. Again this pattern could occur as part of the data pay load.3) below. some basic synchronization has to be provided between the multiplexer at the transmitter end and the demux at the Rx end. Lesson 4. and it is this pattern that is used to detect the beginning of the frame. There are different SONET links used for different data rates. The first 2 bytes contain a special bit pattern. SONET This is a standard which specifies how data is transmitted over optical networks. So the Rx keeps checking at the end of every 810 bytes for the desired pattern. A pattern of alternating 1s and 0s in consecutive frames (101010…) is used as the control sequence. we’ll focus on the framing related aspects alone. known as STS. This pattern is unlikely to be sustained at a single bit position on any data channel.. It also needs to . to make sure it is in sync.

some kind of flow control mechanism is required to handle this.2 Sliding Window: In this scheme. it sends an acknowledgement (Ack). 4. The destination can thus control the flow by withholding or delaying the ack. it will have no place at the Rx and will have to be dropped. Both the Tx and the Rx keep track of a window of frames that need to be sent and received. A source transmits a frame. If a sequence number is given to the frames.1 Stop and Wait: It is the simplest form of flow control. • It is very slow. Hence.4). an Ack will specify the next sequence number that the Rx is ready to accept. After the destination receives it. ACK need not be sent for every frame. it has major disadvantages.do some processing of the data received. Let us see how this works. multiple frames are allowed to be in transit. 4. because we need to wait for the ACK before sending data. • That leads to poor link utilization.2. 4. While this is very simple to implement. o . So it is possible that the buffer gets full. The source waits for the acknowledgement before it sends the next frame. And this window keeps sliding as Acks are received – giving it its name (Fig. The Tx can then send up to n frames starting from the number. Two simple schemes are commonly used- • Stop and wait flow control and • Sliding window flow control. thereby overcoming the inefficiency of the stop and wait protocol. As and when it receives acks from the Rx. The Tx station can send up to n frames without waiting for an Ack. • It is wasteful of bandwidth because we cannot send data even if the line is free. o Again. it can send additional frames.2. It works as follows : o Assume that the Rx station has a buffer space for n frames. And if the Transmitter continues to send the data.

It is interesting to note that a continuous running sequence number need not be used. where n is the window size. This is clearly an overhead and we need to determine the number of bits to be allocated to this field. .o Fig 4. a 3 –bit field can be used and the frames numbered from 0 to 7. therefore has to have a sequence number field. 4.5) below.4 Sliding window flow control • Every frame. Instead the sequence number can repeat from φ after n frames. • Thus if n=7. A typical sequence of transfers is shown in the figure (Fig. • Try to figure out why we need 8 sequence numbers for a window size of 7.


it can again send an Ack or Receiver Ready Signal to resume the transmission.Fig 4. When ready. Window size shrinks from 7 to 4. the Rx may also send a RNR – receiver not ready signal. and sequence numbers from 0 to 7. . • In addition to a positive Ack. the Ack field is normally piggybacked (literally sent on its back) on the data frame being sent in the opposite direction. See how the windows shrink and expand (shown by the arrows) as data is sent and Acks are received.5 A sequence of data transfer using sliding window flow control Assume window size n = 7. to stop the Tx. Understand this protocol well . and then back to 7 and so on. • When both sides are transmitting and receiving.It’s the basis for reliable transmission in TCP.

3. the probability of a frame being in error is of a higher magnitude. Also. i. else error!! . CRC. It basically works as follows : • The message bits treated as a polynomial with binary coefficients is divided by a CRC polynomial. The remainder obtained is the CRC. 4. and P is the CRC polynomial of n+1 bits. So some error control mechanism is required.Lesson 4. Just XOR all the bits to generate the parity bit and send that along. What if the BER is very low? Do we still need error detection? Given the bit error rate. Error correction is a more tedious process.3. Transmit T+F. A reminder of zero indicates no error. Construct T = 2nM Divide T by P. Divide 2nM+F by P.2 Cyclic Redundancy Check (CRC) This is one of the powerful error-detecting codes. Hence we’ll focus on the error detection techniques. And it often turns out that even for low BER. • If M is a message of k bits. This can detect cases where odd number of bits are in error. which is appended to the message bits. This is based on modulo-2 arithmetic.3 Error Control This refers to the detection of errors that occur during transmission. it is possible to find the probability of a frame being in error.2nM+F At Rx. n If. At the Rx. n-bit remainder F is the Frame check sequence or the CRC. as long as we detect that a frame is in error.1 Parity Check This is the simplest of all schemes – you must be familiar with this. 2 of them. Rx checks for the valid parity bit.How noisy is the channel? What is the bit-error rate (BER)? How good is the error detection technique etc. the CRC appended message is treated as a polynomial and divided by the same CRC polynomial. and their correction. 2 M/P +F/P = F/P+F/P =0 no error. else error. 4. because it depends on many factors . the procedure is as follows. we can always have it retransmitted.Parity check.e. and has higher over heads. Is it possible to detect all errors and correct them? – Difficult to give an absolute answer.

Hence no error!! What is the trick here – it is in choosing the polynomial. The basis (Mathematics) for this comes from the topic of Fields and Groups. At Tx: 1111011 1101) 1001001000 1101 1000 1101 1010 1101 1111 1101 1000 1101 1010 1101 111 = R The new message is 1001001111. An important point to note is that the coefficients of xn and x0 should always be 1. At Rx: 1111011 1101) 1001001111 1101 1000 1101 1010 1101 1111 1101 1011 1101 1101 1101 0 = R. If(x+1) is a factor of the polynomial then all odd bit errors can be deducted. Don’t . The polynomial should have certain characteristics so that certain kinds of errors can be detected.Let us look at an example. and a CRC of 1101. Consider a message M = 1001001.

Another is that the frame might just not be received. (i) The frame sent may be in error which is detected at the destination. 2 types of errors could occur.CCITT x16+x12+x5+1 CRC -32 x +x +x23+c22+c16+x12+x11+x10+x8+x7+x5+x4+x2+1 32 26 Another interesting feature of this technique is that it can be easily implemented in hardware using a feed-back shift register. so that if you need it at some point of time. If an Ack is not received within a certain time. Note that otherwise. this would be an additional overhead in transmitting each frame of data. and the timer expires. Also. so that this calculation can actually be done on-the-fly. (ii) The frame could have reached correctly. before it transmits another frame. . Some of these are : CRC – 16 x16+x15+x2+1 CRC . Actually there are 2 categories of errors.worry too much about it.3 ARQ Three common mechanisms exist. One is receiving an erroneous frame which we detect using an FCS or some such scheme. you can refer to it. our life has been made much simpler by researchers who have already identified some standard polynomials which are widely used today. that frame is resent. a transmitter transmits a frame and then waits for an ack to come from the receiver. Given that we have a mechanism for detecting errors. 4. what does error control involve? We’ll look at that now. Or the frame may be lost in transit. • In stop and wait. • During this. the Rx does not send an Ack. They are referred to as automatic repeat request (ARQ) mechanisms. Stop and wait ARQ: • This is based on the stop and wait flow control technique. In either case.3. They are : o Stop and wait ARQ o Go-back–N ARQ o Selective reject ARQ. a timer is associated with each frame that is sent. The transmitter would be waiting for ever! To break this “Never-ending-wait”. Just remember where it comes from.lost frames!! Both these situations need to be handled by the error control mechanism. But the Ack sent by the receiver may be in error or be lost.

To avoid this. frames may be alternately labeled with a 0 and 1. and the corresponding Acks as ack1 and ack0. The duplicate frame will be accepted by the receiver as a separate frame. This simple scheme will take care of the duplicate frame problem and provide a “slow but steady” kind of solution.Now. .6). and resend the frame. This mechanism is depicted in the following figure (fig 4. again the transmitter will time-out.

6 Stop and Wait ARQ Go-back-N ARQ:- This goes with the sliding –window flow control mechanism.Fig 4. the number of un-acknowledged frames is determined by the window size N. . Recollect that in the sliding window technique.

• However. and there is no RR or REJ from the receiver or lets say the RR or REJ was lost. it’s timer for ’i’ would expire. The destination will then respond with an RR for the last frame that it received correctly. there is a p-bit timer associated with a p-bit frame. • The source on receiving the REJ for i. • The frame i is lost in transit. If the transmitter also had no further frames to send. This is done for a set maximum number of times . it will send a REJ i frame (Rejection for i). then an RR for a subsequent frame may be received at the source before the timer for i expires. • An example showing a sequence of operations is depicted in the figure below (fig 4. • If the acknowledgement RR(i+1) sent for a frame i is lost. it rejects the frames that has been received “out-of-order” by sending a REJi.before the transmitter actually gives up and resets the entire procedure or reports an error. • While no errors occur.because acks are cumulative-An RR for j acks all frames up to j-1. and this frame or the response to it gets lost-then what happens? To take care of this. Stn A . and discard all frames that come after that. • If a frame is lost in transit.. The source will then resend frames starting from i. This is a kind of query to the destination. and then the source can start resending from the next frame. the sequence just continues. but the frame i+1 is received by the destination. and it sends an RR frame with the p-bit set. the destination will acknowledge the incoming frames by sending an RR frame (Receive Ready) • If it detect an error in frame i.7). the p-bit frame will be resent.Basic Mechanism: Following cases occur. but the source has sent further frames which have been received by the destination. if the senders timer expires. starting from the ith frame. This will expire. Then it sends and ‘’RR’ frame to the destination with what is known as a poll –bit or p-bit set. will resend all the frames that it has already sent. If this expires. In that case.

station A resends all frames starting from frame 3. Receiver replies are sent for frames 0-2. Meanwhile. B sends an ACK (RR) but it is lost.7 Go-back N ARQ Station A sends frames 0 to 5. Frame 3 is lost. subsequent acks for frames 4 and 5 arrive. it is out of sequence. However. When frame 4 arrives at B. frames 4 and 5 are taken as ACKed. On receiving frame 3. On receiving the REJ3 frame. Since ACKs are cumulative. hence a REJ3 frame is sent.Fig 4. frame 6 .

• There are protocols which define how the functionality is achieved. How are errors identified ? 10. • The connectivity consists of just not the physical connection. A sends frame 6 again. • As per the OSI standard. So it could cumulatively ack the frames received up to that time after it receives the retransmitted frame. but multiple layers of logical connection that allow two applications to talk to each other. . session. reaches B. they are : physical. and B ACKs it. transport. How does window-based flow control work ? 9. the maximum window size should be no more than half the range of the sequence number. What is meant by ARQ ? 12. Selective – reject ARQ: o This is an improvement on the Go-back-N ARQ. A timeout occurs at A for frame 6. but B does not respond with an ACk for some reason. presentation and application layers. network. Instead of retransmitting all frames starting from the REJected frame. o An SREJ is sent for the frame in error. What is meant by CRC ? 11. What are the three primary schemes used to identify frames ? 4. • The entire set of operations required for a network is often organized into layers with distinct functions. What is meant by flow-control ? 7. What should go into a frame ? 3. What is meant by framing ? 2. • The complexity of the network grows as more machines are added. What is the basis of clock-based framing ? 6. o For this to work. only the erroneous frame is ‘selectively’ retransmitted. data link. On receiving that B responds with an RR for 5. Can you say why? Have you understood ? 1. What is Go-back-n ARQ ? Unit 1 Summary • A network is formed when two or more machines are interconnected. Why is bit stuffing necessary ? 5. and it sends a RR frame with a P-bit set. The receiver accepts frames that have been received out-of-order. What is the problem with stop-and-wait flow control ? 8. and only that is retransmitted.

• On detection of errors. transmission etc. • A bit pattern. • The TCP/IP is one such stack that has become an alternative to the OSI model and more popular.• A collection of protocols operating at various layers is called a protocol stack. the erroneous frames are dropped. • Flow control is to regulate flow of data between two machines with different capacity – to prevent a fast sender from overwhelming a slow receiver. or a known format may be used to identify beginning and end of frames. • Acknowledgements are used by receiver to let the sender know that it has received the data. retransmission of frames is requested by the receiver. Among the guided. . • Framing. a byte pattern. twisted pair and optical fibre cables are popular for their cost and speed respectively. • The physical media may be guided (wired) or unguided (wireless). but you can’t go beyond that until you get the ACKs for the previous frames transmitted. • The data link layer deals with making sense out of the raw bits transmitted. • In sliding window flow control. • The retransmission request mechanism is closely tied to the flow control mechanism adopted. as in stop and wait flow control where one frame is sent only after the previous is acknowledged. flow control and error control are three important functions of the data link layer. • Errors will occur during transmission. • Framing deals with organizing raw bits into a structure that is convenient for processing. • The physical layer determines how and the rate at which the raw bits are actually transmitted. • We need mechanisms to identify errors and take corrective action. a window of n frames may be continuously transmitted without waiting for ACKs. • The same acknowledgements may also be used to regulate the flow of data. • CRC is a commonly used error detection scheme.

It adds header and trailer information that is available to its counterpart on the system that will receive it. The user at the receiving end b. it is called a. Multitasking d. Multiprogramming c.Objective type questions 1. It adds header and trailer information that is available to its counterpart on the system that will receive it. b. Multicasting 6. never implemented because of the lack of ISO standards d. The Internet a. Software b. Protocols are most often implemented in a. allows multiplexing d. 4. the way in which the data are passed between layers in the TCP/IP architecture b. d. c. has the attribute of service generality c. The workstation at the transmitting end . 2. Each layer of the OSI model uses encryption to put the PDU from the upper layer into its data field. and c 7. b. Which is the best definition of encapsulation? a. Layers c. A protocol stack is a. Multiplexing b. a. software that implements the layers of a protocol. a set of rules for making a sandwich c. Data always needs to be tunneled to its destination so encapsulation must be used. When a computer uses a single communication circuit/channel to establish multiple connections to different applications. a & b e. Each layer of the OSI model uses compression to put the PDU from the upper layer into its data field. all of the above 5. It adds header and trailer information so that its counterpart on the system that will receive it correctly. The header in a PDU contains information to be used by a. Hardware d. Each layer of the OSI model puts the PDU from the upper layer into its data field. is implemented using the TCP/IP protocol b.

Stop and go d. From the standpoint of connection. Zeroing b. Synchronizing c. Stop and hop c. b& c 9. Stop and wait . Check damming d. The transmission is being aborted b. Flow control c. The term used to describe the ability of the receiving end to limit the amount or rate at which data is sent by the transmitting end is a. there are two basic types of data transmission. A collision occurs d. Transmit control b. When two stations transmit at the same time a. a & b e. Polling occurs 13. The transmission should be ignored d. An altercation occurs b. Unconnected b. A division occurs c. the term is called a. This is the end of transmission c. The owner of the communication link d. Connectionless d. the type of flow control being used is a. it means that a. They are a. The peer layer in the receiving machine 8. Sliding window b. when a 0 is inserted after all strings of five consecutive 1s. Connection-oriented c. String breaking d. In HDLC. When a receiver must acknowledge every block of data before the next block is sent. Flow limiting 10. Bit stuffing 12. The characters that follow are to be interpreted as having an alternate meaning 11. When an ESC character is sent as part of a message. c.

A serial line interface protocol c. Repeater . Techniques to ensure that a fast transmitting node does not send data faster than the receiving node can receive and process are called a. The name of the flow control protocol in which the sending station resends the damaged or out of sequence frame and all frame after it. An error has occurred b. A device that operates at the physical layer and is used to regenerate signals is called a. Provides additional bits so that errors can be corrected at the receiving end c. It should switch modes 17. All of the above e. Sliding window 15. Gateway b. Selective reject b. None of the above 16. Parity checking b. Sliding window flow control b.14. It should signal the sender to stop sending d. Can detect single bit error in transmission b. CRC c. Uses Hamming code to improve accuracy of data 20. CRC a. Go-back-n d. Can detect an even number of bit errors c. Error control 18. Requires a math coprocessor to calculate its value d. Selective repeat c. HDLC is an example of a. it knows that a. Is not used if the circuits are at parity with one another 19. An asynchronous protocol d. Is a particular implementation of a more general class of error detection techniques called polynomial error checking b. A frame is beginning or ending c. When a HDLC node receives a flag character. Adds an odd bit. Flow control d. on receipt of a NAK is a. Parity checking a. even if no errors occur d.

(b) With the selective repeat protocol. Justify your answer.25 secs. A system has an n-layer protocol hierarchy. Show the CRC calculation involved in sending and receiving a message 1101001001 using a CRC polynomial 1001. What are the 5 layers in an internet protocol stack ? Which of these layers does a router possess ? 3. Explain. State true or false. it is possible for the sender to receive an ACK for a packet that falls outside its current window. Switch d. What fraction of the network bandwidth is filled with headers? 2. Bridge Exercises : 1. 4. an h-byte header is added. Explain the principle behind CRC. it is possible for the sender to receive an ACK for a packet that falls outside of its current window. which type of ARQ protocol (selective reject or go-back-n ) would be less of a burden to the server. With Go-back-N. List the functions to be performed by a data link control protocol. c. . it is possible for the sender to receive an ACK for a packet that falls outside of its current window. (a) With Go-back N it is possible for the sender to receive an ACK for a packet that falls outside its current window. At each of the layers. Why are they needed? 5. How would you determine the number of bits for the sequence number field in a sliding window protocol ? Calculate the number of bits in the sequence number field for a 1 Mbps link with a one-way latency of 1. 9. Applications generate messages of length M bytes. 6. With a selective repeat protocol. Answer true or false and justify your answer for the following : a. assuming that each frame carries 1KB of data. 8. b. 10. Show by example that Go-back-n requires a sequence number of 2n for a window size of n. 7. but transmits very large messages to them. A world-wide web server receives relatively small messages from its clients.