eec-484/584 computer networks discussion session for data link layer wenbing zhao [email protected]

17
EEC-484/584 EEC-484/584 Computer Computer Networks Networks Discussion Session for Discussion Session for Data Link Layer Data Link Layer Wenbing Zhao Wenbing Zhao [email protected]

Upload: linda-maxwell

Post on 19-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

EEC-484/584EEC-484/584Computer Computer NetworksNetworks

Discussion Session for Data Discussion Session for Data Link LayerLink Layer

Wenbing ZhaoWenbing Zhao

[email protected]

Page 2: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

ReminderReminder

Wiki project: Peer review due midnight today!

Quiz #4 (Lecture 12-14, Lab 5) Wednesday, May 12 6-8pm

04/18/2304/18/23 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks Wenbing ZhaoWenbing Zhao

Page 3: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

04/18/2304/18/23 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks Wenbing ZhaoWenbing 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

Page 4: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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

04/18/2304/18/23 Wenbing ZhaoWenbing ZhaoEEC-484/584: Computer NetworksEEC-484/584: Computer Networks

Page 5: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

04/18/2304/18/23 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks Wenbing ZhaoWenbing 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?

Page 6: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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

Page 7: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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.

Page 8: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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.

Page 9: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

04/18/2304/18/23 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks Wenbing ZhaoWenbing Zhao

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?

Page 10: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

04/18/2304/18/23 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks Wenbing ZhaoWenbing Zhao

Q4. SolutionQ4. 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

Page 11: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

04/18/2304/18/23 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks Wenbing ZhaoWenbing 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?

Page 12: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

04/18/2304/18/23 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks Wenbing ZhaoWenbing Zhao

Q5. SolutionQ5. 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

Page 13: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 5-5-1313

Q6. Self-Learning Multi-Q6. Self-Learning Multi-SwitchSwitchSuppose C sends frame to I, I responds to C

Q: show switch tables and frame forwarding in S1, S2, S3, S4

A

B

S1

C D

E

FS2

S4

S3

H

I

G

1

2

04/18/2304/18/23

Page 14: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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>

Page 15: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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

Page 16: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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 won’t receive the frame from I!

Page 17: EEC-484/584 Computer Networks Discussion Session for Data Link Layer Wenbing Zhao wenbingz@gmail.com

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