An output interface in a switch is designed using the leaky bucket algorithm to send 8000 bytes/s (tick). If the following frames are received in sequence, show the frames that are sent during each second:ch
Answers
send 8000 bytes/s (tick). If the following frames are received in sequence, show the
frames that are sent during each second.
Frames 1, 2, 3, 4: 4000 bytes each
Frames 5, 6, 7: 3200 bytes each
Frames 8, 9: 400 bytes each
Frames 10, 11, 12: 2000 bytes each
Answer:
Second 1: Frames 1,2
Second2: Frames 3,4
Second 3: Frames 5,6
Second 4: Frames 7 to 11
and at second 5: Frame 12
Explanation:
Given Frames with sizes as,
1,2,3,4 each of 4000 Bytes
5,6,7 each of 3200 Bytes
8,9 each of 400 Bytes
10,11,12 each of 2000 Bytes
Second 1: counter set to 8000 Bytes,
Frame 1 is sent and now counter=4000 Bytes
Frame 2 is also sent because counter >= frame 2 size and counter=0 Bytes now.
Frame 3 can't be sent.
Reset the counter.
Second 2:
Frame 3 is sent and now counter=4000 Bytes
Frame 4 is also sent because counter >= frame 2 size and counter=0 Bytes now.
Frame 5 can't be sent.
Reset the counter.
Similarly,
at Second 3:
Frames 5,6 are sent and Frame 7 is rejected because it's size is greater than counter
at Second 4:
Frames 7 to 11 are sent but Frame 12 is rejected for the same reason.
at Second 5:
Frame 12 is sent.