Sunteți pe pagina 1din 17

EEC-484/584

Computer
Discussion Session for Data
Networks
Link Layer
Wenbing Zhao
wenbingz@gmail.com

Reminder

Wiki project:

Peer review due midnight today!

Quiz #4 (Lecture 12-14, Lab 5)

11/09/16

Wednesday, May 12 6-8pm

EEC-484/584: Computer Networks

Wenbing Zhao

Q1. The following character encoding is used in a data


link protocol: A: 01000111; B: 11100011; FLAG:
01111110; ESC: 11100000 Show the bit sequence
transmitted (in binary) for the four-character frame: A B
ESC FLAG when each of the following framing
methods are used:
(a) Character count.
(b) Flag bytes with byte stuffing.
(c) Starting and ending flag bytes, with bit stuffing

11/09/16

EEC-484/584: Computer Networks

Wenbing Zhao

Q1.Solution:
(a) 4 characters in the frame, so prefix and 5, i.e.,
00000101
00000101 01000111 11100011 11100000 01111110
(b) FLAG A B ESC ESC ESC FLAG FLAG, i.e.,
01111110 (FLAG) 01000111 (A) 11100011 (B)
11100000 (ESC) 11100000 (ESC) 11100000 (ESC)
01111110 (FLAG, in original frame) 01111110 (FLAG)
(c) 01111110 01000111 110100011 111000000
011111010 01111110

11/09/16

EEC-484/584: Computer Networks

Wenbing Zhao

Q2. To provide more reliability than a single


parity bit can give, an error-detecting coding
scheme uses one parity bit for checking all the
odd-numbered bits and a second parity bit for all
the even-numbered bits. What is the Hamming
distance of this code?

11/09/16

EEC-484/584: Computer Networks

Wenbing Zhao

Q2 Solution

Making one change to any valid character cannot


generate another valid character
Due to the nature of parity bits, making two changes
to even bits or two changes to odd bits will give
another valid character, so the distance is 2

Q3. A bit stream 10011101 is to be


transmitted using the standard CRC method
described in the text. The generator
polynomial is x3 + 1. Show the actual bit
string transmitted. Suppose the third bit from
the left is inverted during transmission. Show
that this error is detected at the receiver's
end.

Q3. Solution:
The frame is 10011101. The generator is 1001. The
message after appending
three zeros is 10011101000. The remainder on
dividing 10011101000 by
1001 is 100. So, the actual bit string transmitted is
10011101100. The
received bit stream with an error in the third bit from
the left is 10111101100.
Dividing this by 1001 produces a remainder 100,
which is different from zero.
Thus, the receiver detects the error and can ask for
a retransmission.

Q4. An IP packet to be transmitted by


Ethernet is 60 bytes long. Is padding needed
in the Ethernet frame, and if so, how many
bytes?

11/09/16

EEC-484/584: Computer Networks

Wenbing Zhao

Q4. Solution

The minimum Ethernet frame is 64 bytes, including


both addresses in the Ethernet frame header, the
type/length field, and the checksum
Since the header fields occupy 18 bytes and the
packet is 60 bytes, the total frame size is 78 bytes,
which exceeds the 64-byte minimum
Therefore, no padding is used

11/09/16

EEC-484/584: Computer Networks

Wenbing Zhao

Q5. Consider building a CSMA/CD network


running at 1 Gbps over a 1-km cable. The
signal speed in the cable is 200,000 km/sec.
What is the minimum frame size?

11/09/16

EEC-484/584: Computer Networks

Wenbing Zhao

Q5. Solution

For a 1-km cable, the one-way propagation time is 5


sec, so 2 = 10 sec
To make CSMA/CD work, it must be impossible to
transmit an entire frame within this interval
At 1 Gbps, all frames shorter than 10,000 bits can
be completely transmitted in under 10 sec
So the minimum frame is 10,000 bits or 1250 bytes

11/09/16

EEC-484/584: Computer Networks

Wenbing Zhao

Q6. Self-Learning MultiSwitch


Suppose C sends frame to I, I responds to C
S4

1
S1

2
S2

A
B

S3
F

D
E

I
G

Q: show switch tables and frame forwarding in

S1 , S 2 , S 3 , S 4

11/09/16

EEC-484/584: Computer Networks

5-13
5-13

Q6. Solution

S1

When frame from C arrived, S1 floods it on all


interfaces except S1-C.
In the mean time, it adds an entry in its switch
table: <C, 3, ttl>
When the frame from I arrived, S1 forward it
directly to C on interface 3
Also, S1 adds an entry in its switch table: <I, 4,
ttl>

S4:

When it receives the frame from C, S4 adds an


entry in its switch table: <C, 1, ttl>
S4 then floods the frame to all other interfaces (2
and 3)
When the frame from I arrives at S4, S4 adds an
entry in its switch table: <I, 3, ttl>
Since frame from I is for destination C, and there
is already an entry for C in the switch table, S4
directly forward the frame to interface 1

S2:

When it receives the frame from C, S2 adds an


entry to its switch table: <C,4, ttl>
It then floods the frame to all other interfaces
It wont receive the frame from I!

S3:

When it receives the frame from C, it adds an


entry: <C, 4, ttl>
It then floods the frame to all other interfaces
When it receives the frame from I, it adds another
entry: <I, 3, ttl>
It then forward the frame directly to 4 since there
is an entry for C in its switch table

S-ar putea să vă placă și