Vous êtes sur la page 1sur 10

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:

3456

ABCC

0 2 BC
EEEE

Sum 1 D1CC

Total Sum=D1CD

Complement=2E32

(b) At receiver side:

3456

ABCC

0 2 BC

EEEE

2E 3 2

Sum 1 FFFE

FFFF

Comp. 0 0 0 0 (No Error)

(c) if 0xABCC change to 0xABCE


At Receiver side

3456

ABCE

0 2 BC

EEEE

2E 3 2

Sum 1 0 0 0 0

1
0001

Comp. FFFE (Error)

(d) if oxABCC change to 0xABCE and 0x02BC to 0x2BA


3456

ABCE

0 2 BA

EEEE

2E 3 2

Sum 1 FFFE

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 is
added to the data section of the frame when there is a character with the same pattern as
the flag. The data section is stuffed with an extra byte. This byte is usually called the
escape character (ESC), which has a predefined bit pattern. Whenever the receiver
encounters the ESC character, it removes it from the data section and treats the next
character as data, not a delimiting flag.
Byte stuffing by the escape character allows the presence of the flag in the data section
of the frame, but it creates another problem. What happens if the text contains one or
more 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 this
problem, the escape characters that are part of the text must also be marked by another
escape character. In other words, if the escape character is part of the text, an extra one is
added 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
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:
Sender Receiver

Frame 0

ACK 1
Frame 1

Frame 2

ACK 3

Frame 3

Frame 4

Frame 5
NAK 4

Frame 4
ACK 5
Frame 5

ACK 6
Frame 6

ACK 7
Frame 7

ACK 0
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:
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:


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?
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 Passing
In 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 predecessor
is the station which is logically before the station in the ring; the successor is the station
which is after the station in the ring. The current station is the one that is accessing the
channel now. The right to this access has been passed from the predecessor to the current
station. The right will be passed to the successor when the current station has no
more data to send.
But how is the right to access the channel passed from one station to another? In
this method, a special packet called a token circulates through the ring. The possession
of 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 data
to send, it releases the token, passing it to the next logical station in the ring. The station
cannot 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 the
next station.
Token management is needed for this access method. Stations must be limited in
the time they can have possession of the token. The token must be monitored to ensure
it 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 is
to 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 highpriority
stations.

Vous aimerez peut-être aussi