Homework Title / No. : 3 Course Code

13
Homework Title / No. : _____________3_______________________Course Code : ____CAP 306 Course Instructor : __jasleen kaur____ Course Tutor (if applicable) : ____________ Date of Allotment : _____16 Nov 09___________ Date of submission : _20 nov 2009______________ Student’s Roll No._____RD3803A24_ Section No. : ____D3803_________ Declaration: I declare that this assignment is my individual work. I have not copied from any other student’s work or from any other source except where due acknowledgment is made explicitly in the text, nor has any part been written for me by another person. Student’s Signature : ___PUNEET__ Evaluator’s comments: _____________________________________________________________________ Marks obtained : ___________ out of ______________________ Content of Homework should start from this page only: Que1: A sender needs to send the four data items Ox3456, OxABCC, Ox02BC, and OxEEEE. Answer the following: a. Find the checksum at the sender site. b. Find the checksum at the receiver site if there is no error. c. Find the checksum at the receiver site if the second data item is changed to OxABCE.

Transcript of Homework Title / No. : 3 Course Code

Page 1: Homework Title / No. :              3                       Course Code

Homework Title / No. : _____________3_______________________Course Code : ____CAP 306

Course Instructor : __jasleen kaur____ Course Tutor (if applicable) : ____________

Date of Allotment : _____16 Nov 09___________ Date of submission : _20 nov 2009______________

Student’s Roll No._____RD3803A24_ Section No. : ____D3803_________

Declaration: I declare that this assignment is my individual work. I have not copied from any other student’s work or from any other source except where due acknowledgment is made explicitly in the text, nor has any part been written for me by another person.

Student’s Signature : ___PUNEET__

Evaluator’s comments: _____________________________________________________________________

Marks obtained : ___________ out of ______________________

Content of Homework should start from this page only:

Que1: A sender needs to send the four data items Ox3456, OxABCC, Ox02BC, and OxEEEE.

Answer the following:

a. Find the checksum at the sender site.

b. Find the checksum at the receiver site if there is no error.

c. Find the checksum at the receiver site if the second data item is changed to

OxABCE.

d. Find the checksum at the receiver site if the second data item is changed to

OxABCE and the third data item is changed to Ox02BA.

Ans

(a) At sender side:

3 4 5 6

ABCC

0 2 BC

Page 2: Homework Title / No. :              3                       Course Code

EEEE

Sum 1 D1CC

1

Total Sum=D1CD

Complement=2E32

(b) At receiver side:

3 4 5 6

ABCC

0 2 BC

EEEE

2E 3 2

Sum 1 FFFE

1

FFFF

Comp. 0 0 0 0 (No Error)

(c) if 0xABCC change to 0xABCE At Receiver side

3 4 5 6

ABCE

0 2 BC

EEEE

2E 3 2

Sum 1 0 0 0 0

1

Page 3: Homework Title / No. :              3                       Course Code

0 0 0 1

Comp. FFFE (Error)

(d) if oxABCC change to 0xABCE and 0x02BC to 0x2BA3 4 5 6

ABCE

0 2 BA

EEEE

2E 3 2

Sum 1 FFFE

1

FFFF

Comp. 0 0 0 0 (No Error)

Que2: Compare and contrast byte-stuffing and bit-stuffing. Which technique is used in

byte-oriented protocols? Which technique is used in bit-oriented protocols?.

Ans:In byte stuffing (or character stuffing), a special byte isadded to the data section of the frame when there is a character with the same pattern asthe flag. The data section is stuffed with an extra byte. This byte is usually called theescape character (ESC), which has a predefined bit pattern. Whenever the receiverencounters the ESC character, it removes it from the data section and treats the nextcharacter as data, not a delimiting flag.Byte stuffing by the escape character allows the presence of the flag in the data sectionof the frame, but it creates another problem. What happens if the text contains one ormore escape characters followed by a flag? The receiver removes the escape character,but keeps the flag, which is incorrectly interpreted as the end of the frame. To solve thisproblem, the escape characters that are part of the text must also be marked by anotherescape character. In other words, if the escape character is part of the text, an extra one isadded to show that the second one is part of the text.

Byte stuffing is used in byte-oriented protocols.

Bit stuffing:

Bit stuffing is the process of adding one extra 0 whenever five consecutive 18 follow a 0

Page 4: Homework Title / No. :              3                       Course Code

in the data, so that the receiver does not mistake the pattern 0111110 for a flag.

Bit stuffing is used in bit-oriented protocols

Que3 : Draw the sender and receiver windows for a system using go-back –n ARQ given the following:-

Frame 0 is sent ; frame 0 is acknowledged Frame 1 & 2 are sent; frames 1 and 2 are acknowledged Frames 3,4, 5 are sent; NAK 4 is received Frames 4, 5,6,7 are sent, frames 4 through 7 are acknowledged

Ans:

Page 5: Homework Title / No. :              3                       Course Code

ACK 0

Frame 7

ACK 7

Frame 6

ACK 6

Frame 5

ACK 5

Frame 4

NAK 4

Frame 5

Frame 4

Frame 3

ACK 3

Frame 2

Frame 1ACK 1

Frame 0

Sender Receiver

Page 6: Homework Title / No. :              3                       Course Code

Que4: Computer A uses stop-and-wait ARQ protocol to send packets to compute B . If the distance between A and B is 4000km, how long does it take computer A to receive acknowledgement for a packet? Use the speed of light for propagation speed and assume time between receiving & sending acknowledgment is 0.

Ans: Distance=4000km = 4000*1000=4000000m

Speed of light=300000000m/s

Time =Distance/speed

=4000000/300000000 =0.013m/s (approx)

PART B

1. A message is broken up into three pieces .Discuss the transmission of packets using switched virtual circuits

Ans: The switched virtual circuit creates a temporary, short connection that exist only when data are being transferred between source and destination. An switched virtual circuit requires a connection phase. Suppose source A needs to create a virtual circuit to B. Two steps are.

Setup Phase:

Acknowledgement:

Page 7: Homework Title / No. :              3                       Course Code

2..How long does a stations,have to wait in the worst case before it can start transmitting its frame over a LAN that uses

i)The basic Bit-map Protocol?

ii)Mok and Ward’s Protocol with permuting Virtual station Numbers.?

Ans:

A Bit-Map Protocol

In our first collision-free protocol, the basic bit-map method, each contention period consists of exactly N slots. If station 0 has a frame to send, it transmits a 1 bit during the zeroth slot. No other station is allowed to transmit during this slot. Regardless of what station 0 does, station 1 gets the opportunity to transmit a 1 during slot 1, but only if it has a frame queued. In general, station j may announce that it has a frame to send by inserting a 1 bit into slot j. After all N slots have passed by, each station has complete knowledge of which stations wish to transmit. At that point, they begin transmitting in numerical order.

Since everyone agrees on who goes next, there will never be any collisions. After the last ready station has transmitted its frame, an event all stations can easily monitor, another N bit contention period is begun. If a station becomes ready just after its bit slot has passed by, it is out of luck and must remain silent until every station has had a chance and the bit map has come around again. Protocols like this in which the desire to transmit is broadcast before the actual transmission are called reservation protocols.

Mok and Ward:

Page 8: Homework Title / No. :              3                       Course Code

Mok and Ward (1979) have described a variation of binary countdown using a parallel rather than a serial interface. They also suggest using virtual station numbers, with the virtual station numbers from 0 up to and including the successful station being circularly permuted after each transmission, in order to give higher priority to stations that have been silent unusually long. For example, if stations C, H, D, A, G, B, E, F have priorities 7, 6, 5, 4, 3, 2, 1, and 0, respectively, then a successful transmission by D puts it at the end of the list, giving a priority order of C, H, A, G, B, E, F, D. Thus, C remains virtual station 7, but A moves up from 4 to 5 and D drops from 5 to 0. Station D will now only be able to acquire the channel if no other station wants it.

3.How a slotted ALOHA type of satellite packet broadcasting network is an improvement over pure ALOHA.

Pure ALOHA

The basic idea of an ALOHA system is simple: let users transmit whenever they have data to be sent. There will be collisions, of course, and the colliding frames will be damaged. However, due to the feedback property of broadcasting, a sender can always find out whether its frame was destroyed by listening to the channel, the same way other users do. With a LAN, the feedback is immediate; with a satellite, there is a delay of 270 msec before the sender knows if the transmission was successful. If listening while transmitting is not possible for some reason, acknowledgements are needed. If the frame was destroyed, the sender just waits a random amount of time and sends it again. The waiting time must be random or the same frames will collide over and over, in lockstep. Systems in which multiple users share a common channel in a way that can lead to conflicts are widely known as contention systems.

Slotted ALOHA

In 1972, Roberts published a method for doubling the capacity of an ALOHA system (Roberts, 1972). His proposal was to divide time into discrete intervals, each interval corresponding to one frame. This approach requires the users to agree on slot boundaries. One way to achieve synchronization would be to have one special station emit a pip at the start of each interval, like a clock.

In Roberts' method, which has come to be known as slotted ALOHA, in contrast to Abramson's pure ALOHA, a computer is not permitted to send whenever a carriage return is typed. Instead, it is required to wait for the beginning of the next slot. Thus, the continuous pure ALOHA is turned into a discrete one. Since the vulnerable period is now halved, the probability of no other traffic during the same slot as our test frame is e-G.

4. Problem that can arise if receiving of frames is slower at receiver end as compare to sending of frames at sender end? How it can be resolved?

Page 9: Homework Title / No. :              3                       Course Code

Ans: A frame is defined as a group of bits representing a block of data. A sender can send no. of frames one after another. As frames arrive over the network into the socket buffer, there may be drops in the buffer due to an excess of frames. In addition, when these frames are passed to the application, some of them may be dropped periodically in a controlled way if the sender’s sound card runs at a higher realized sampling rate than the receiver’s card. The loss concealment module conceals the effect of these losses on the stream before the stream is passed to the receiver. It is also possible that the receiver runs at a higher realized sampling rate than the sender. In this case, instead of dropping frames periodically, the application would have to insert a controlled number of frames periodically, and the loss concealment module would again be called into operation in order to smooth the transitions between frames introduced due to this action.

5.What conditions would have to hold for a corrupted frame to circulate forever on a token ring without a monitor?How does the monitor fix the problem?

Token PassingIn the token-passing method, the stations in a network are organized in a logical ring.In other words, for each station, there is a predecessor and a successor. The predecessoris the station which is logically before the station in the ring; the successor is the stationwhich is after the station in the ring. The current station is the one that is accessing thechannel now. The right to this access has been passed from the predecessor to the currentstation. The right will be passed to the successor when the current station has nomore data to send.But how is the right to access the channel passed from one station to another? Inthis method, a special packet called a token circulates through the ring. The possessionof the token gives the station the right to access the channel and send its data.When a station has some data to send, it waits until it receives the token from its predecessor.It then holds the token and sends its data. When the station has no more datato send, it releases the token, passing it to the next logical station in the ring. The stationcannot send data until it receives the token again in the next round. In this process,when a station receives the token and has no data to send, it just passes the data to thenext station.Token management is needed for this access method. Stations must be limited inthe time they can have possession of the token. The token must be monitored to ensureit has not been lost or destroyed. For example, if a station that is holding the token fails,the token will disappear from the network. Another function of token management isto assign priorities to the stations and to the types of data being transmitted. And finally,token management is needed to make low-priority stations release the token to highprioritystations.

Page 10: Homework Title / No. :              3                       Course Code