Chapter 5
Link Layer
Computer Networking: A
Top Down Approach
4th edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2007.
Last Lecture

Link Layer Switches
Todays’ Lecture

Address Resolution Protocol
(ARP)
Switch
 Link-layer Device

Store, forward Ethernet frames
 Examine incoming frame’s MAC address
 Selectively forward frame to the outgoing link
 Switch itself is transparent to the nodes
 Nodes are unaware of presence of switches
 Plug-and-Play
 Switches do not need to be configured
 Two important functions:
 Filtering


• Determines whether a frame should be forwarded to
some interface or should be dropped.


Forwarding
• Determine the interface to which a frame should be
directed
Switch Table


Q: How does switch know that
A’ reachable via interface 4,
B’ reachable via interface 5?

A

C’

B

 A: Each switch has a switch

table, each entry:
 MAC address of a host
 Interface that leads
towards the host
 Time at which the entry
for the node as placed in
the table

 How is the table created?

6

1
5

2

3

4
C

B’

A’
switch with six interfaces
(1,2,3,4,5,6)
Switch: self-learning
 switch

learns which hosts

can be reached through
which interfaces




Source: A
Dest: A’

A A A’

C’

when frame received,
switch “learns” location of
sender: incoming LAN
segment
records sender/location
pair in switch table

B
1

6

5

2

3

4
C

B’

A’

MAC addr interface TTL
A

1

60

Switch table
(initially empty)
Self-Learning,Forwarding:Example

Source: A
Dest: A’

A A A’

C’

B

 frame destination
unknown: flood

6
A A’

1

2
4

5

 destination A

location known:
selective send

C

A’ A
B’

3

A’

MAC addr interface TTL
A
A’

1
4

60
60

Switch table
(initially empty)
Interconnecting Switches
 switches can be connected together
S4

S1

S2

A
B

S3

C

F

D
E

I
G

H

 Q: sending from A to G - how does S1 know to

forward frame destined to G via S4 and S3?
 A: self learning! (works exactly the same as in
single-switch case!)
Switch: Advantages

 Elimination of Collisions:
 Switches

buffer frames and never transmit
more than one frame on any segment at one
time
 Modern switches are Full Duplex
 Heterogeneous Links
 Switch isolates one link from another
 Different links can operate at different
speeds and over different media
Difference between Hubs and Switches?
Difference between Switches and Routers?
(Home Assignment)
MAC Addresses
 32-bit IP address:


network-layer address

used to get datagram to destination IP subnet
 MAC (or LAN or physical or Ethernet) address:
 A node also has a link layer address


• Nodes adapter


6 Bytes (48 bit) MAC address (for most LANs)
• Expressed in Hexadecimal notation

 No two adapters have the same MAC address
 IEEE manages the MAC address space
 MAC address does not change no matter where the adapter
goes
 MAC address: like NIC number

IP address: like postal address
MAC Addresses
Each adapter on LAN has unique LAN address

1A-2F-BB-76-09-AD

71-65-F7-2B-08-53

LAN
(wired or
wireless)

Broadcast address =
FF-FF-FF-FF-FF-FF

= adapter
58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98
ARP: Address Resolution Protocol
 How does the sending node A with IP

222.222.222.220 determine the MAC address for the
destination node B with IP address say
222.222.222.222?
 Job of Address Resolution Protocol (ARP)
 ARP module in the sending node
• Takes IP address on the same LAN as input
• Return corresponding MAC address
 Each node has an ARP table



Contains mapping of IP addresses to MAC addresses
The ARP table contains a time-to-live (TTL) value
• Indicates when each mapping will be deleted from the table
• Typical expiration time is 20 minutes
ARP: Same LAN (network)
 A wants to send datagram

to B, and B’s MAC address
not in A’s ARP table.
 A broadcasts ARP query
packet, containing B's IP
address
 Destination MAC
address = FF-FF-FF-FFFF-FF
 All machines on LAN
receive ARP query
 B receives ARP packet,
replies to A with its (B's)
MAC address


Frame sent to A’s MAC
address (unicast)

 A caches (saves) IP-to-

MAC address pair in its
ARP table until information
becomes old (times out)

 ARP is “plug-and-play”:
 nodes create their ARP
tables without
intervention from
network administrator
Addressing: Routing to another LAN
Send datagram from A to B via Router (R)
assume A knows B’s IP address
88-B2-2F-54-1A-0F

74-29-9C-E8-FF-55

A

111.111.111.111

E6-E9-00-17-BB-4B
1A-23-F9-CD-06-9B

222.222.222.220
111.111.111.110
111.111.111.112

R

222.222.222.221

222.222.222.222

B

49-BD-D2-C7-56-2A

CC-49-DE-D0-AB-7D

 Router has two interfaces, two IP addresses, two ARP

modules and two adapters
 A creates IP datagram with destination IP of B
 A uses ARP to get MAC address of R (111.111.111.110)
 A creates link-layer frame with R's MAC address as dest,







frame contains A-to-B IP datagram
A’s adapter sends frame
R’s adapter receives frame
R removes IP datagram from frame, sees its destined to B
R uses ARP to get B’s MAC address
R creates frame containing A-to-B IP datagram and sends to
B
88-B2-2F-54-1A-0F

74-29-9C-E8-FF-55

A

E6-E9-00-17-BB-4B

111.111.111.111

222.222.222.220
111.111.111.110
111.111.111.112

CC-49-DE-D0-AB-7D

222.222.222.221

1A-23-F9-CD-06-9B

R

222.222.222.222

B

49-BD-D2-C7-56-2A
Announcements
 Lab Final on Wednesday, 1st January 2014
Every

one has to be present at 2pm
Objective paper: 25 min at 2pm
Hands-on Exam: 45 min
For Hands-on Exam: Class divided into
two groups
On the Spot Marking of Hands-on
Exam
Announcements
 Research Presentations/Demos
 Thursday

2nd January, 2014
• 12pm-1pm and 3pm-5pm
 Friday 3rd January, 2014
• 11am-1pm and 2pm- 4pm
 Bring hardcopy of your allocated Paper and
report


Viva/Report for programming project

 Paper Showing on 15th January, 2014 after

exam of Software Engineering at 1pm.


Venue will be notified via email

Week16 lec1

  • 1.
    Chapter 5 Link Layer ComputerNetworking: A Top Down Approach 4th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
  • 2.
  • 3.
  • 4.
    Switch  Link-layer Device Store,forward Ethernet frames  Examine incoming frame’s MAC address  Selectively forward frame to the outgoing link  Switch itself is transparent to the nodes  Nodes are unaware of presence of switches  Plug-and-Play  Switches do not need to be configured  Two important functions:  Filtering  • Determines whether a frame should be forwarded to some interface or should be dropped.  Forwarding • Determine the interface to which a frame should be directed
  • 5.
    Switch Table  Q: Howdoes switch know that A’ reachable via interface 4, B’ reachable via interface 5? A C’ B  A: Each switch has a switch table, each entry:  MAC address of a host  Interface that leads towards the host  Time at which the entry for the node as placed in the table  How is the table created? 6 1 5 2 3 4 C B’ A’ switch with six interfaces (1,2,3,4,5,6)
  • 6.
    Switch: self-learning  switch learnswhich hosts can be reached through which interfaces   Source: A Dest: A’ A A A’ C’ when frame received, switch “learns” location of sender: incoming LAN segment records sender/location pair in switch table B 1 6 5 2 3 4 C B’ A’ MAC addr interface TTL A 1 60 Switch table (initially empty)
  • 7.
    Self-Learning,Forwarding:Example Source: A Dest: A’ AA A’ C’ B  frame destination unknown: flood 6 A A’ 1 2 4 5  destination A location known: selective send C A’ A B’ 3 A’ MAC addr interface TTL A A’ 1 4 60 60 Switch table (initially empty)
  • 8.
    Interconnecting Switches  switchescan be connected together S4 S1 S2 A B S3 C F D E I G H  Q: sending from A to G - how does S1 know to forward frame destined to G via S4 and S3?  A: self learning! (works exactly the same as in single-switch case!)
  • 9.
    Switch: Advantages  Eliminationof Collisions:  Switches buffer frames and never transmit more than one frame on any segment at one time  Modern switches are Full Duplex  Heterogeneous Links  Switch isolates one link from another  Different links can operate at different speeds and over different media Difference between Hubs and Switches? Difference between Switches and Routers? (Home Assignment)
  • 10.
    MAC Addresses  32-bitIP address:  network-layer address used to get datagram to destination IP subnet  MAC (or LAN or physical or Ethernet) address:  A node also has a link layer address  • Nodes adapter  6 Bytes (48 bit) MAC address (for most LANs) • Expressed in Hexadecimal notation  No two adapters have the same MAC address  IEEE manages the MAC address space  MAC address does not change no matter where the adapter goes  MAC address: like NIC number IP address: like postal address
  • 11.
    MAC Addresses Each adapteron LAN has unique LAN address 1A-2F-BB-76-09-AD 71-65-F7-2B-08-53 LAN (wired or wireless) Broadcast address = FF-FF-FF-FF-FF-FF = adapter 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98
  • 12.
    ARP: Address ResolutionProtocol  How does the sending node A with IP 222.222.222.220 determine the MAC address for the destination node B with IP address say 222.222.222.222?  Job of Address Resolution Protocol (ARP)  ARP module in the sending node • Takes IP address on the same LAN as input • Return corresponding MAC address  Each node has an ARP table   Contains mapping of IP addresses to MAC addresses The ARP table contains a time-to-live (TTL) value • Indicates when each mapping will be deleted from the table • Typical expiration time is 20 minutes
  • 13.
    ARP: Same LAN(network)  A wants to send datagram to B, and B’s MAC address not in A’s ARP table.  A broadcasts ARP query packet, containing B's IP address  Destination MAC address = FF-FF-FF-FFFF-FF  All machines on LAN receive ARP query  B receives ARP packet, replies to A with its (B's) MAC address  Frame sent to A’s MAC address (unicast)  A caches (saves) IP-to- MAC address pair in its ARP table until information becomes old (times out)  ARP is “plug-and-play”:  nodes create their ARP tables without intervention from network administrator
  • 14.
    Addressing: Routing toanother LAN Send datagram from A to B via Router (R) assume A knows B’s IP address 88-B2-2F-54-1A-0F 74-29-9C-E8-FF-55 A 111.111.111.111 E6-E9-00-17-BB-4B 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 111.111.111.112 R 222.222.222.221 222.222.222.222 B 49-BD-D2-C7-56-2A CC-49-DE-D0-AB-7D  Router has two interfaces, two IP addresses, two ARP modules and two adapters
  • 15.
     A createsIP datagram with destination IP of B  A uses ARP to get MAC address of R (111.111.111.110)  A creates link-layer frame with R's MAC address as dest,      frame contains A-to-B IP datagram A’s adapter sends frame R’s adapter receives frame R removes IP datagram from frame, sees its destined to B R uses ARP to get B’s MAC address R creates frame containing A-to-B IP datagram and sends to B 88-B2-2F-54-1A-0F 74-29-9C-E8-FF-55 A E6-E9-00-17-BB-4B 111.111.111.111 222.222.222.220 111.111.111.110 111.111.111.112 CC-49-DE-D0-AB-7D 222.222.222.221 1A-23-F9-CD-06-9B R 222.222.222.222 B 49-BD-D2-C7-56-2A
  • 16.
    Announcements  Lab Finalon Wednesday, 1st January 2014 Every one has to be present at 2pm Objective paper: 25 min at 2pm Hands-on Exam: 45 min For Hands-on Exam: Class divided into two groups On the Spot Marking of Hands-on Exam
  • 17.
    Announcements  Research Presentations/Demos Thursday 2nd January, 2014 • 12pm-1pm and 3pm-5pm  Friday 3rd January, 2014 • 11am-1pm and 2pm- 4pm  Bring hardcopy of your allocated Paper and report  Viva/Report for programming project  Paper Showing on 15th January, 2014 after exam of Software Engineering at 1pm.  Venue will be notified via email