You are on page 1of 32

CS2302 Computer Networks Question Bank with Answer for I & II units Unit I Part A (2 Marks) 1.

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). 2. 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, 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 networks robustness in a catastrophe. Security issues include protecting data from unauthorized access and viruses. 3. Group the OSI layers by function. The seven layers of the OSI model belonging to three subgroups. network support layers: Consisting of Physical, data link and network layers and they deal with the physical aspects of moving data from one device to another. User support layers: Consists of Session, presentation and application layers and they allow interoperability among unrelated software systems. The transport layer ensures end-to-end reliable data transmission 4. What are the features provided by layering?
It decomposes the problem of building a network into more manageable components. Rather than implementing a monolithic piece of software that does everything implement several layers, each of which solves one part of the problem. It provides more modular design. To add some new service, it is enough to modify the functionality at one layer, reusing the functions provided at all the other layers.

5. What are the two interfaces provided by protocols?


Service interface Peer interface

Service interface-defines the operations that local objects can perform on the protocol. Peer interface-defines the form and meaning of messages exchanged between protocol peers to implement the communication service.

6. What is flow Control?


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

7. Define Error detection and correction. Error Detection:


Data can be corrupted during transmission. It is called as an error. For reliable communication, the receiver must find out the errors occurred in the data which is called as error detection.

Error Correction: It is the mechanism to correct the errors and it can be handled in 2 ways. a) When an error is discovered, the receiver can have the sender retransmit the entire data unit. b) A receiver can use an error correcting coder, which automatically corrects certain error 8. What is the use of two dimensional parity in error detection? Two-dimensional parity check increases the likelihood of detecting burst errors. It is used to detect errors occurred in more than one bits. 9. What are the issues in data link layer?
The data link layer has a number of specific functions it can carry out. These functions include a) Providing a well-defined service interface to the network layer. b) Dealing with transmission errors. c) Regulating the flow of data so that slow receivers are not swamped by fast senders.

10. What are the different encoding techniques? The different encoding techni ques are:
NRZ NRZI Manchester 4B/5B

11. Mention the different physical media?

The different physical media are a) Co axial cable b) UTP cable c) Fiber optical cable and d) Wireless media (RF signals) 12. What are the ways to address the framing problem? The framing problem can be addressed by the following protocols:
Byte-Oriented Protocols(PPP) Bit-Oriented Protocols(HDLC) Clock-Based Framing(SONET)

PART B
1. Draw the ISO-OSI reference model and explain the functionalities of each layer in detail

ISO defines a common way to connect computer by the architecture called Open System Interconnection(OSI) architecture. Network functionality is divided into seven layers.

Organization of the layers The 7 layers can be grouped into 3 subgroups

1. Network Support Layers Layers 1,2,3 - Physical, Data link and Network are the network support layers. They deal with the physical aspects of moving data from one device to another such as electrical specifications, physical addressing, transport timing and reliability. 2. Transport Layer Layer4, transport layer, ensures end-to-end reliable data transmission on a single link. 3. User Support Layers Layers 5,6,7 Session, presentation and application are the user support layers. They allow interoperability among unrelated software systems

An Data exchange using the OSI model

Functions of the Layers

1. Physical Layer The physical layer coordinates the functions required to transmit a bit stream over a physical medium.

The physical layer is concerned with the following: Physical characteristics of interfaces and media - The physical layer defines the characteristics of the interface between the devices and the transmission medium. Representation of bits - To transmit the stream of bits, it must be encoded to signals. The physical layer defines the type of encoding. Data Rate or Transmission rate - The number of bits sent each second is also defined by the physical layer. Synchronization of bits - The sender and receiver must be synchronized at the bit level. Their clocks must be synchronized. Line Configuration - In a point-to-point configuration, two devices are connected together through a dedicated link. In a multipoint configuration, a link is shared between several devices. Physical Topology - The physical topology defines how devices are connected to make a network. Devices can be connected using a mesh, bus, star or ring topology.

Transmission Mode - The physical layer also defines the direction of transmission between two devices: simplex, half-duplex or full-duplex. 2. Data Link Layer It is responsible for transmitting frames from one node to next node.

The other responsibilities of this layer are Framing - Divides the stream of bits received into data units called frames. Physical addressing If frames are to be distributed to different systems on the n/w , data link layer adds a header to the frame to define the sender and receiver. Flow control- If the rate at which the data are absorbed by the receiver is less than the rate produced in the sender ,the Data link layer imposes a flow ctrl mechanism. Error control- Used for detecting and retransmitting damaged or lost frames and to prevent duplication of frames. This is achieved through a trailer added at the end of the frame. Access control -Used to determine which device has control over the link at any given time.

3. NETWORK LAYER This layer is responsible for the delivery of packets from source to destination.

It is mainly required, when it is necessary to send information from one network to another. The other responsibilities of this layer are Logical addressing - If a packet passes the n/w boundary, we need another addressing system for source and destination called logical address. Routing The devices which connects various networks called routers are responsible for delivering packets to final destination. 4. TRANSPORT LAYER It is responsible for Process to Process delivery. It also ensures whether the message arrives in order or not.

The other responsibilities of this layer are Port addressing - The header in this must therefore include a address called port address. This layer gets the entire message to the correct process on that computer. Segmentation and reassembly - The message is divided into segments and each segment is assigned a sequence number. These numbers are arranged correctly on the arrival side by this layer. Connection control - This can either be connectionless or connectionoriented. The connectionless treats each segment as a individual packet and

delivers to the destination. The connection-oriented makes connection on the destination side before the delivery. After the delivery the termination will be terminated. Flow and error control - Similar to data link layer, but process to process take place. 5.SESSION LAYER This applications. layer establishes, manages and terminates connections between

The other responsibilities of this layer are

Dialog control - This session allows two systems to enter into a dialog either in half duplex or full duplex. Synchronization-This allows to add checkpoints into a stream of data. 6.PRESENTATION LAYER

It is concerned with the syntax and semantics of information exchanged between two systems.

The other responsibilities of this layer are Translation Different computers use different encoding system, this layer is responsible for interoperability between these different encoding methods. It will change the message into some common format. Encryption and decryption-It means that sender transforms the original information to another form and sends the resulting message and vice versa. Compression and expansion-Compression reduces the number of bits contained in the information particularly in text, audio and video. 7 APPLICATION LAYER This layer enables the user to access the n/w. This allows the user to log on to remote user. over the n/w.

The other responsibilities of this layer are

FTAM(file transfer,access,mgmt) - Allows user to access files host. Mail services - Provides email forwarding and storage.

in a remote

Directory services - Provides database sources to access information about various sources and objects.

2. Compare the OSI reference model with TCP reference model. Explain how the layers can be grouped?

Although OSI is by far the most popular - there are other models as well. Pay particular attention the the TCP/IP layered model below, and how it relates to the OSI model:

The 7 Layers
Although there are seven layers in the OSI model, they can be grouped into three areas:

High-level Protocols (layers 5, 6 and 7 - Session, Presentation, and Application) - how the data is presented, displayed, and summarized for the user - and in the reverse direction, how the user prepared data is assembled into meaningful data structures (high-level protocols). Medium-level Protocols (Layers 3 and 4 - Network and Transport) how the data is assembled into packets and frames and how error

checking and flow control is implemented - and in the reverse direction, how the received packets and frames are assembled into structures such as files and databases (medium-level protocols) Low-level Protocols (Layers 1 and 2 - Physical and DataLink) - how the data is converted into electrical pulses of ones's and zero's (bits) and sent across cables or the physical medium, and in the reverse direction, how the electrical pulses are taken off the cable and converted to ones and zero's.

The following Table describes each layer:


This layer supports application and end-user processes. Communication partners are identified, quality of service is identified, user authentication and privacy are considered, and any constraints on data syntax are Application identified. Everything at this layer is application-specific. This layer provides application services for file transfers, e-mail, and other network (Layer 7) software services. Telnet and FTP are applications that exist entirely in the application level. Tiered application architectures are part of this layer. This layer provides independence from differences in data representation (e.g., encryption) by translating from application to network format, and Presentation vice versa. The presentation layer works to transform data into the form that the application layer can accept. This layer formats and encrypts (Layer 6) data to be sent across a network, providing freedom from compatibility problems. It is sometimes called the syntax layer.

Session (Layer 5) Transport (Layer 4)

This layer establishes, manages and terminates connections between applications. The session layer sets up, coordinates, and terminates conversations, exchanges, and dialogues between the applications at each end. It deals with session and connection coordination. Usually TCP (the top half of TCP/IP). This layer provides transparent transfer of data between end systems, or hosts, and is responsible for end-to-end error recovery and flow control. It ensures complete data transfer. Typically IP (the bottom half of TCP/IP). This layer provides switching and routing technologies, creating logical paths, known as virtual circuits, for transmitting data from node to node. Routing and forwarding are functions of this layer, as well as addressing, internetworking, error handling, congestion control and packet sequencing. Ethernet, ATM, Frame Relay, etc. At this layer, data packets are encoded and decoded into bits. It furnishes transmission protocol knowledge and management and handles errors in the physical layer, flow control and frame synchronization. The data link layer is divided into two sublayers: The Media Access Control (MAC) layer and the Logical

Network (Layer 3)

Data Link (Layer 2)

Link Control (LLC) layer. The MAC sublayer controls how a computer on the network gains access to the data and permission to transmit it. The LLC layer controls frame synchronization, flow control and error checking.

Physical (Layer 1)

This layer conveys the bit stream - electrical impulse, light or radio signal -- through the network at the electrical and mechanical level. It provides the hardware means of sending and receiving data on a carrier, including defining cables, cards and physical aspects. Fast Ethernet, RS232, and ATM are protocols with physical layer components.

3. Explain the different types of multiplexing. Multiplexing is the technique that allows the simultaneous transmission of multiple signals across a single data link or channel. The process of multiplexing increases the bandwidth requirement for the transmission. Multiplexing System resources are shared among multiple users. Frequency-division multiplexing (FDM) is an analog technique that can be applied when the band width of a link (in Hz) is greater than the combined bandwidth signals to be transmitted. In FDM signal generated by each sending device modulates different carrier frequencies. These modulated signals are then combined in to a single composite signal that can be transmitted by the link. Carrier frequencies are separated by sufficient bandwidth ranges of the channels through which the various signals travel. Channels must be separated by strips of unused bandwidth (guard bands) to prevent signals from overlapping. FDM is an analog multiplexing technique that combines signal. Example: Radio, television broad casting, etc.

Application of FDM FDM is used for A.M. Radio & Radio broadcasting. 550 KHz bandwidth is assign to each station. FDM is used for T.V broadcasting. In this frequency range is 80 108 MHz. In this each channel is of 700 Mhz. Advantages OF FDM Simple Inexpensive Popular with Radio, TV, Cable TV All the receivers, cellular telephones, need not to be at the same location It is not sensitive to propagation delays.

It allows maximum transmission link usage. Disadvantages OF FDM In FDM there is need of filters, which are very expensive and complicated to construct and design. Analog signal only having limited frequency range. Sometimes, it is necessary to use more complex linear amplifiers in FDM systems.

Time Division Multiplexer Time Division multiplexing (TDM) is a digital process. It allows several connections to share the high bandwidth of a link. Instead of sharing a portion of the bandwidth as in FDM, here in TDM time is shared. Each connection occupies a portion of time in the link. Example: telephone system In this figure of TDM a portion of signals 1,2,3 and 4 occupy the link sequentially. The analog signals are digitized at the end office by a device called a Codec (Coder-Decoder), producing a series of 8-bit numbers. Time Slots and Frames The data flow of each connection is divided in to units and the link combines one unit of each connections to make a frame. The size of the unit can be one bit or several bits. For n input connections a frame is organized in to minimum of n time slots. Each slot is carrying one unit from each connection as shown in figure 1.1 Telephone companies implements TDM.

Types of TDM Synchronous TDM Asynchronous TDM or Statistical TDM Synchronous Time Division Multiplexing In Synchronous Time Division Multiplexing, multiplexer allocates exactly the same time slot to each device at all times. For Example: Time slot A, is assigned to device A alone and cannot be used by any other device. Each time its allocated time slot comes up, a device has the opportunity to send a portion of its data. If a device is has to transmit or does not have data to send, its time slot remains empty.

Synchronous Time Division Multiplexing T-1 multiplexing (the classic) ISDN (Integrated Services Digital Networks) multiplexing SONET (Synchronous Optical NETwork)

Advantages of synchronous TDM Digital signals Relatively simple Commonly used with ISDN (Integrated Services digital network) Disadvantages of synchronous TDM Wastage of bandwidth Asynchronous TDM: Asynchronous means something different in multiplexing in the area of data communication. It means flexible or not fixed. Suppose number of inputs =5, then number of slots in each frame = 3 Asynchronous Multiplexer transmits only the data from active work stations. If the workstation is not active, no space is wasted on the multiplexed streams.

A Statistical or Asynchronous multiplexers occupy the incoming data streams and creates frames containing only the data to be transmitted. Hence, the Asynchronous Time Division Multiplexing or Statistical TDM is designed to avoid this type of wastage of bandwidth. Diffrence between FDM & TDM

4. Explain the following error detecting / correcting mechanisms i. Parity bit ii. Check sum iii. Cyclic Redundancy check iv. Hamming code
Parity Check Simple parity check Only one redundant bit, called parity bit is added to every data unit so that the total number of 1s 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.

Fig: Two-dimensional parity 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 1s 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. Instead of sending the checksum as such, ones 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. Sender 7 5 9 Receiver 7 5 9 9 1010 1 1

1111 0 1

Simplified example internet checksum calculation Assume the packet header is: 01 00 F2 03 F4 F5 F6 F7 00 00 (00 00 is the checksum to be calculated) The first step is to form 16-bit words. 0100 F203 F4F5 F6F7 The second step is to calculate the sum using 32-bits. 0100 + F203 + F4F5 + F6F7 = 0002 DEEF The third step is to add the carries (0002) to the 16-bit sum. DEEF + 002 = DEF1 The fourth step is to take the complement. (1s becomes 0s and 0s become 1s) ~DEF1 = 210E So the checksum is 21 0E. The packet header is sent as: 01 00 F2 03 F4 F5 F6 F7 21 0E At the receiver, the steps are repeated. The first step is to form 16-bit words. 0100 F203 F4F5 F6F7 210E The second step is to calculate the sum using 32-bits. 0100 + F203 + F4F5 + F6F7 + 210E = 0002 FFFD The third step is to add the carries (0002) to the 16-bit sum. FFFD + 0002 = FFFF which means that no error was detected. (In 1s complement, zero is 0000 or FFFF.)

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 8 9 Consider the original message as M(x) n+1 bits Divisor C(x) K bits

10 Original sent message = M(x) + k-1 bits

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

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

Calculating the r values

Place each bit of the original character in its appropriate position in the 11bit 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.

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.

Error detection

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 1s 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.

5. Discuss about various link level flow control.


Link Level Flow Control Flow control is a technique that a transmitting entity does not conquer a receiving entity with data. Two fundamental mechanisms are acknowledgement and timeouts. After getting each frame the receiver will send ACK to sender. If the sender does not receive ACK up to reasonable amount of time then it retransmit the original frame waiting for reasonable amount of time is called timeout. The two flow control mechanisms are Stop and wait Flow Control Sliding Window Flow Control Stop and Wait Algorithm After transmitting one frame, the sender waits for an

acknowledgment before transmitting the next frame. If the acknowledgment does not arrive after a certain period of time, the sender times out and retransmit the original frame.

a) The ACK is received before the timer expires

b) The original frame is lost

c) The ACK is lost

d)The timeout fires too soon

Fig: illustrates four different scenarios that result from this basic algorithm. The sending side is represented on the left, the receiving side is depicted on the right, and time flows from top to bottom.

In Fig (a) ACK is received before the timer expires, (b) and (c) show the situation in which the original frame and the ACK, respectively, are lost, and (d) shows the situation in which the timeout fires too soon.. Suppose the sender sends a frame and the receiver acknowledges it, but the acknowledgment is either lost or delayed in arriving. This situation is in (c) and (d). In both cases, the sender times out and retransmit the original frame, but the receiver will think that it is the next frame, since it correctly received and acknowledged the first frame. This makes the receiver to receive the duplicate copies. To avoid this two sequence numbers (0 and 1) must be used alternatively.

The main drawback of the stop-and-wait algorithm is that it allows the sender have only one outstanding frame on the link at a time. Sliding Window Algorithm The sender can transmit several frames before needing an acknowledgement. Frames can be sent one right after another meaning that the link can carry several frames at once and it s capacity can be used efficiently. The receiver acknowledges only some of the frames, using a single ACK to confirm the receipt of multiple data frames Sliding Window refers to imaginary boxes at both the sender and the receiver. 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. Frames are numbered modulo-n which means they are numbered from o to n-1 For eg. If n=8 the frames are numbered 0,1,2,3,4,5,6,7. i.e the size of the window is n -1. When the receiver sends ACK it includes the number of the next frame it expects to receive.

When the sender sees an ACK with the number 5, it knows that all frames up through number 4 have been received.

There are two methods to retransmit the lost frames GO-Back N Selective Repeat Go Back N Method Sender Window

At the beginning of transmission, the sender window contains n-1 frames. As frames are sent out, the left boundary of the window moves inward, shrinking the size of the window If size of window is W if three frames have been transmitted since the last acknowledgement then the number of frames left in the window is w -3. Once an ACK arrives, the window expands to allow in a number of new frames

equal to the number of frames acknowledged by that ACK.

Receiver Window

The receive window is an abstract concept defining an imaginary box of size 1 with one single variable Rn. The window slides when a correct frame has arrived, sliding occurs one slot at a time.

When the timer expires, the sender resends all outstanding frames. For example, suppose the sender has already sent frame 6, but the timer for frame 3 expires. This means that frame 3 has not been acknowledged; the sender goes back and sends frames 3, 4,5, and 6 again. That is why the protocol is called Go-Back-N.

Selective Repeat

Sender Window

Receiver window

The Selective Repeat Protocol allows as many frames as the size of the receive window to arrive out of order and be kept until there is a set of in-order frames to be delivered to the network layer. Because the sizes of the send window and receive window are the same, all the frames in the send frame can arrive out of order and be stored until they can be delivered. If any frame lost, sender has to retransmit only that lost frames.

6. Explain various multiple access techniques.


Multiple Access Techniques Various multiple access techniques are Frequency Division Multiple Access(FDMA) Time Division Multiple Access (TDMA) Code Division Multiple Access(CDMA) Frequency Division Multiple Access In frequency-division multiple access (FDMA), the available bandwidth is divided into frequency bands. Each station is allocated a band to send its data.

In this method when any one frequency level is kept idle and another is used frequently leads to inefficiency. f f5 f4 f3 f2 Time Division Multiple Access In time-division multiple access (TDMA), the stations share the bandwidth of the channel in time. Each station is allocated a time slot during which it can send data. The main problem with TDMA lies in achieving synchronization between the different stations. Each station needs to know the beginning of its slot and the location of its slot. f

Code Division Multiple Access CDMA differs from FDMA because only one channel occupies the entire bandwidth of the link. It differs from TDMA because all stations can send data at the same time without timesharing. CDMA simply means communication with different codes.

CDMA is based on coding theory. Each station is assigned a code, which is a sequence of numbers called chips. Chips will be added with the original data and it can be transmitted through same medium.

Code c
C5

c4

c3

You might also like