Вы находитесь на странице: 1из 9

Study Guide & Workbook – CSE 323 – Computer Networks Dept.

of CSE, UIU

CHAPTER 5
Data Link Layer

5.1 Link Layer: Introduction and Services


5.1.1 The Services Provided by the Link Layer
5.1.2 Where Is the Link Layer Implemented?

5.3 Multiple Access Protocols


5.3.1 Channel Partitioning Protocols
5.3.2 Random Access Protocols
5.3.3 Taking-Turns Protocols
5.3.4 Local Area Networks (LANs)

5.4 Link-Layer Addressing


5.4.1 MAC Addresses
5.4.2 Address Resolution Protocol (ARP)
5.4.3 Link Layer Switches

5.5 Ethernet
5.5.1 Ethernet Frame Structure
5.5.2 CSMA/CD: Ethernet's Multiple Access Protocol
5.5.3 Ethernet Technologies

© 2017 – Mohammad MamunElahi Page 1 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

5.1 Link Layer: Introduction and Services


 Data Link Layer Services: Framing, Link access

5.3 Multiple Access Protocols


 Channel Partitioning: FDMA, TDMA
 Random Access:CSMA/CD
 Taking Turns: Token ring

© 2017 – Mohammad MamunElahi Page 2 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

5.4 Link-Layer Addressing


 Address Resolution Protocol (ARP)

 MAC Table

 Exercise 1:
Consider the figure below. The IP and MAC addresses are shown for nodes A, B, C and D, as well as
for the router's interfaces. Consider an IP datagram being sent from node C to node A.

i. Why ARP protocol is needed?

ii. Consider an ARP request send by node C. Which IP address will respond to the request?

iii. Now, the ARP table is filled up. For the data packet from C-to-A, what are the MAC source
and destination address and IP source and destination addresses at points (6), (4), (2), and
(1)?

© 2017 – Mohammad MamunElahi Page 3 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

 Exercise 2:
Let’s consider the operation of a learning switch in the context of a network in which 6 nodes labeled
A through F are star connected into an Ethernet switch. Suppose that (i) B sends a frame to E, (ii) E
replies with a frame to B, (iii) A sends a frame to B, (iv) B replies with a frame to A. The switch table is
initially empty. Show the state of the switch table before and after each of these events. For each of
these events, identify the link(s) on which the transmitted frame will be forwarded, and briefly justify
your answers.

Action Switch Table State Link(s) packet is Explanation


forwarded to
B sends a frame to E

E replies with a
frame to B

A sends a frame to B

B replies with a
frame to A

5.4 Switched Local Area Networks

© 2017 – Mohammad MamunElahi Page 4 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

Knowledge Test # 1
Q.1 Describe 6 (six) data link layer services.

Q.2 Why Multiple Access Protocols (MAC) are used? Describe 3 (three) basic categories of MAC
protocols (Channel partitioning, random access and taking turns).

Q.3 Why physical (MAC) address is needed in hardware (LAN card/NIC)?

Q.4 Why Address Resolution Protocol(ARP) is used in LANs?

© 2017 – Mohammad MamunElahi Page 5 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

5.5 Ethernet
 Exercise 3:
Consider the figure below. Now, we replace the router between subnets 1 and 2 with a switch S1, and
label the router between subnets 2 and 3 as R1.

a. Consider sending an IP datagram from Host E to Host F. Will Host E ask router R1 to help
forward the datagram? Why? In the Ethernet frame containing the IP datagram, what are the
source and destination IP and MAC addresses?

b. Suppose E would like to send an IP datagram to B, and assume that E’s ARP cache does not
contain B’s MAC address. Will E perform an ARP query to find B’s MAC address? Why? In
the Ethernet frame (containing the IP datagram destined to B) that is delivered to router R1,
what are the source and destination IP and MAC addresses?

c. Suppose Host A would like to send an IP datagram to Host B, and neither A’s ARP cache
contains B’s MAC address nor does B’s ARP cache contain A’s MAC address. Further
suppose that the switch S1’s forwarding table contains entries for Host B and router R1
only. Thus, A will broadcast an ARP request message. What actions will switch S1 perform
once it receives the ARP request message? Will router R1 also receive this ARP request
message? If so, will R1 forward the message to Subnet 3? Once Host B receives this ARP
request message, it will send back to Host A an ARP response message. But will it send an
ARP query message to ask for A’s MAC address? Why? What will switch S1 do once it
receives an ARP response message from Host B?

© 2017 – Mohammad MamunElahi Page 6 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

 CSMA/CD

 Exercise 4:
Two hosts, A and B, are connected to an Ethernet Network along with some other hosts. Host A
wishes to send frame aandhost B wants to send frame bto some other hosts on the Ethernet.
Suppose that host A has had 5 collisions while trying to send frame a (with some hosts other than host
B) and host B has had 3 collisions while trying to send frame b (with some hosts other than host A). At
time T, only hosts A and B are the ones that are ready to transmit some data. All other hosts remain
idle.
a. What is the maximum number K that A & B can get to calculate waiting time for
retransmission?

b. If bit time is 1 µs, K= 10 for A, K = 5 for B, calculate waiting times for both A and B.

© 2017 – Mohammad MamunElahi Page 7 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

Knowledge Test # 2
Q.1 What is Ethernet?

Q.2 Why CSMA/CD is used in LANs?

Q.3 Consider Figure 5.33. Now we replace the router between subnets 2 and 3with a switch S2, and
label the router between subnets 1 and 2 as R1.

a. Consider sending an IP datagram from Host E to Host F. Will Host E ask router R1 to help forward the
datagram? Why? In the Ethernet frame containing the IP datagram, what are the source and destination IP and
MAC addresses?
b. Suppose Host E would like to send an IP datagram to Host B, and assume that E’s ARP cache does not
contain B’s MAC address. Will E perform an ARP query to find B’s MAC address? Why? In the Ethernet frame
(containing the IP datagram destined to B) that is delivered to router R1, what are the source and destination IP
and MAC addresses?
c. Suppose Host A would like to send an IP datagram to Host B, and neither A’s ARP cache contains B’s
MAC address nor does B’s ARP cache contain A’s MAC address. Further suppose that the switch S1’s (switch
connecting A and B) forwarding table contains entries for Host B and router R1 only. Thus, A will broadcast an
ARP request message.
i. What actions will switch S1 perform once it receives the ARP request message?
ii. Will router R1 also receive this ARP request message? If so,will R1 forward the message to Subnet 2?
iii. Once Host B receives this ARP request message, it will send back to Host A an ARP response message.
But will it send an ARP query message to ask for A’s MAC address? Why?
iv. What will switch S1 do once it receives an ARP response message from Host B?

© 2017 – Mohammad MamunElahi Page 8 of 9


Study Guide & Workbook – CSE 323 – Computer Networks Dept. of CSE, UIU

The Complete Life of a Web Page Fetch – An Example

The Complete Life of a Web Page Fetch.


In the above figure, you connect your laptop via Ethernet to a local area network. Hosts on the LAN
have IP addresses out of the 141.9.8/24 block, with a corresponding netmask of 255.255.255.0. For
each host, the diagram shows its MAC address and its IP address. (We use shortened MAC addresses
of just 3 digits to make them easier to write down.) Your laptop’s MAC address is 2:4:6. It initially does
not have an IP address, though once it acquires one, it will be 141.9.8.21. You type
http://www.youtube.com into your browser’s URL line and hit return. Back comes the YouTube home
page.
List and briefly describe each step.

© 2017 – Mohammad MamunElahi Page 9 of 9