0% found this document useful (0 votes)
72 views80 pages

Chapter - 6 - Datalink Layer

The document discusses the purpose and services of the data link layer, including framing, link access, reliable delivery, error detection and correction. It describes MAC sublayer functions like frame assembly, addressing, and error detection. Types of link layer errors and error detection processes like parity checking are explained. Finally, it covers multiple access links and protocols like round robin, reservation, and contention-based access.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views80 pages

Chapter - 6 - Datalink Layer

The document discusses the purpose and services of the data link layer, including framing, link access, reliable delivery, error detection and correction. It describes MAC sublayer functions like frame assembly, addressing, and error detection. Types of link layer errors and error detection processes like parity checking are explained. Finally, it covers multiple access links and protocols like round robin, reservation, and contention-based access.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 80

Chapter 5

Data Link Layer

Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012

Link Layer 5-1


Link layer, LANs: outline
5.1 introduction, services 5.5 link virtualization:
5.2 error detection, MPLS
correction 5.6 data center networking
5.3 multiple access 5.7 a day in the life of a
protocols web request
5.4 LANs
▪ addressing, ARP
▪ Ethernet
▪ switches
▪ VLANS

Link Layer 5-2


Purpose of the Data Link Layer

Data Link Layer


Link layer services
❖ Framing: Link-layer protocols encapsulate each network
layer datagram within a link-layer frame before
transmission over the link.
▪ A frame consists of a data field, in which the network-layer
datagram is inserted, and other header fields.
▪ The frame structure is specified by the link-layer protocol.
❖ Link access. A MAC protocol specifies the rules by
which a frame is transmitted onto the link.
▪ For point-to-point links, the MAC protocol is simple – the
sender can send a frame whenever the link is idle.
▪ For multiple nodes sharing a single broadcast link (multiple
access problem), the MAC protocol coordinates the frame
transmissions of the many nodes.

5-4
Link layer services
❖ Reliable delivery. When a link-layer protocol provides
reliable delivery services, it guarantees to move each
network-layer datagram across the link without error.
▪ Similar to a transport-layer reliable delivery service, a link-
layer reliable delivery service can be achieved with
acknowledgments and retransmissions.
▪ A link-layer reliable delivery service is often used for links
prone to high error rates, such as a wireless link to correct an
error locally – on the link where the error occurs.
❖ Error detection & correction. The link-layer hardware in
a receiving node can incorrectly interchange bits due to
signal attenuation and electromagnetic noise.
▪ Link-layer protocols detect such bit errors by having the
transmitting node include error-detection bits in the frame, and
having the receiving node perform an error check.

5-5
Link layer services
Link layer services
MAC Sublayer
Data encapsulation
❖ Frame assembly before transmission and frame
disassembly upon reception of a frame.
❖ MAC layer adds a header and trailer to the packet
❖ Provides three primary functions:
▪ Frame delimiting – Identifies a group of bits that comprise a
frame, synchronization
▪ Addressing –adds a physical address (MAC address) that
enables a frame to be delivered to a destination node.
▪ Error detection –adds a trailer with a cyclic redundancy
check (CRC) of the frame contents.
Framing
Link layer services
❖ flow control:
▪ nodes on each side of a link have a limited amount of packet
buffering capacity
▪ pacing between adjacent sending and receiving nodes
❖ error detection:
▪ errors caused by signal attenuation, noise.
▪ receiver detects presence of errors:
• signals sender for retransmission or drops frame
❖ error correction:
▪ receiver identifies and corrects bit error(s) without resorting to
retransmission
❖ half-duplex and full-duplex
▪ with half duplex, nodes at both ends of link can transmit, but not at
same time

Link Layer 5-10


Where is the link layer implemented?
❖ in each and every host
❖ link layer implemented in
“adaptor” (aka network host schematic
interface card NIC)
▪ Ethernet card, PCMCI card,
application
transport
802.11 card network cpu memory

▪ implements link, physical


link

layer host
bus
❖ attaches into host’s system link
controller (e.g., PCI)
buses physical
physical
❖ combination of hardware, transmission

software, firmware
network adapter
card

11
Types of Errors
Single bit
An error occurs
Error
when a bit is altered
between
transmission and Burst Error – 2 or more bits changed
reception
• Binary 1 is
transmitted and
binary 0 is received
• Binary 0 is
transmitted and
binary 1 is received

5-12
Error Detection Process

Data Link Layer 5-13


two-dimensional bit parity:
Example: Parity checking ❖ detect and correct single bit
 A parity bit is added to every errors
data unit so that the total
number of 1s is even (or odd for
odd-parity).
 A simple parity-check code can
detect an odd number of errors.

single bit parity:


❖detect single bit
errors
Two-dimensional bit parity
TO Read, Internet Checksum and ❖Detect up to 3 bit errors
CRC
Multiple access links, protocols
two types of “links”:
❖ point-to-point
▪ PPP for dial-up access
▪ point-to-point link between Ethernet switch, host
❖ broadcast (shared wire or medium)
▪ Older Ethernet
▪ upstream Hybrid fiber-coaxial (HFC)
▪ 802.11 wireless LAN

shared wire (e.g., shared RF shared humans at a


cabled Ethernet) (e.g., 802.11 WiFi) RF cocktail party
(satellite) (shared air,
acoustical)
Link Layer 5-15
Multiple Access problem
Issues with broadcast (shared wire or medium)
❖ two or more simultaneous transmissions by nodes:
interference
▪ collision if node receives two or more signals at the same
time

multiple access protocol


❖ distributed algorithm that determines how nodes share channel,
i.e., determine when node can transmit

5-16
MAC Protocols

Round Reservation/ Contention


channel
robin partitioning
• All stations
contend for
time
• Each • Divide medium
• Good for bursty
station into slots
traffic
• Good for stream
given turn traffic • Simple to
to implement
transmit • Tends to
collapse under
data heavy load
Round Robin
❖ Each (RR)
station in turn is given the opportunity to transmit.
❖ During that opportunity, the station may decline to
transmit or may transmit subject to a specified upper
bound, usually expressed as a maximum amount of data
transmitted or time for this opportunity.
❖ When done, the station relinquishes its turn, and the right
to transmit passes to the next station in logical sequence.
❖ Control of sequence may be centralized or distributed.
❖ Polling is an example of a centralized technique.
❖ When many stations have data to transmit over an
extended period of time, RR techniques are very efficient.
❖ If only a few stations have data to transmit over an
extended period of time, there is a huge overhead in
passing the turn from station to station, because most of
the stations will not transmit but simply pass their turns.
5-18
RESERVATION
❖ Stream traffic is characterized by lengthy and fairly
continuous transmissions; examples are voice
communication, telemetry, and bulk file transfer.
❖ For stream traffic, reservation techniques are well
suited.
❖ In general, for these techniques, time on the medium is
divided into slots, much as with synchronous TDM.
❖ A station wishing to transmit reserves future slots for
an extended or even an indefinite period.
❖ Again, reservations may be made in a centralized or
distributed fashion.

5-19
CONTENTION
 Bursty traffic is characterized by short, sporadic
transmissions; interactive terminal-host traffic.
 For bursty traffic, contention techniques are usually
appropriate. With these techniques, no control is
exercised to determine whose turn it is;
 All stations contend for time in a way that can be rough
and tumble. These techniques are distributed in nature.
 Their principal advantage is that they are simple to
implement and, under light to moderate load, efficient.
 For some of these techniques, however, performance
tends to collapse under heavy load.
 Although both centralized and distributed reservation
techniques have been implemented in some LANs, R-R
and contention techniques are more common.
5-20
Channel partitioning MAC protocols
TDMA: Time Division Multiple Access
❖ each station gets fixed length slot
❖ unused slots go idle

6-slot 6-slot
frame frame
1 3 4 1 3 4

FDMA: frequency division time


multiple access
frequency bands
❖ channel spectrum divided
into frequency bands
❖ each station assigned fixed
frequency band
Channel partitioning MAC protocols
F/
TDMA
2G Cellular
Networks

CDMA: Code division multiple access


Transmissions are combined on the same channel at the same time but are
separated by codes

3G Cellular
Networks

Data Link Layer 5-22


Random Access Protocols

Characteristics Contention-Based Technologies


• Stations can transmit at any time • CSMA/CD for 802.3 Ethernet
• Collision exist networks
• How to detect collisions • CSMA/CA for 802.11 wireless
• how to recover from collisions networks
(e.g., via delayed • ALOHA
retransmissions)
• There are mechanisms to resolve
contention for the media
CSMA/CD
3.
2. 4.
If the If a collision
1. After
medium is is detected,
transmitting
If the busy, transmit a
the jamming
medium is continue brief
signal, wait
jamming
idle, to listen signal to
a random
transmit; until the amount of
assure that
time,
otherwise, channel is all stations
referred to
go to step idle, then know that
as the
2 transmit there has
backoff, then
been a
immediate collision and
attempt to
ly transmit
cease
again
transmission
“Taking turns” MAC protocols

Characteristics Controlled Access Technologies

• Only one station can transmit at a


time
• Token Ring (IEEE
• Devices wanting to transmit must 802.5)
wait their turn
• No collisions
• Fiber Distributed Data
• May use a token passing method Interface (FDDI)
“Taking turns” MAC protocols
channel partitioning MAC protocols:
▪ share channel efficiently and fairly at high load
▪ inefficient at low load: delay in channel access,
1/N bandwidth allocated even if only 1 active
node!
random access MAC protocols
▪ efficient at low load: single node can fully utilize
channel
▪ high load: collision overhead
“taking turns” protocols
look for best of both worlds!
Link Layer 5-26
“Taking turns” MAC protocols
polling:
❖ master node “invites”
slave nodes to transmit data
in turn pol
l
❖ typically used with
“dumb” slave devices maste
❖ concerns: data r
▪ polling overhead
▪ latency
▪ single point of slave
failure (master) s

Link Layer 5-27


“Taking turns” MAC protocols
token passing:
T
❖ control token passed
from one node to next
sequentially.
❖ token message (nothing
❖ concerns: to send)
▪ token overhead T
▪ latency
▪ single point of failure
(token)

data
Link Layer 5-28
Link layer, LANs: outline
5.1 introduction, services 5.5 link virtualization:
5.2 error detection, MPLS
correction 5.6 data center networking
5.3 multiple access 5.7 a day in the life of a
protocols web request
5.4 LANs
▪ addressing, ARP
▪ Ethernet
▪ switches
▪ VLANS

Link Layer 5-29


MAC addresses and ARP

❖ MAC (or LAN or physical or Ethernet) address:


▪ function: used ‘locally” to get frame from one interface to
another physically-connected interface (same network, in
IP-addressing sense)
▪ 48 bit MAC address (for most LANs) burned in NIC ROM,
also sometimes software settable
▪ e.g.: 1A-2F-BB-76-09-AD

hexadecimal (base 16) notation


(each “number” represents 4 bits)

Link Layer 5-30


LAN addresses and ARP
each adapter on LAN has unique LAN address

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

LAN
(wired or adapter
wireless)
71-65-F7-2B-08-
53 58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

Link Layer 5-31


ARP: Address Resolution Protocol
Question: how to determine
interface’s MAC address, ARP table: each IP node (host,
router) on LAN has table
knowing its IP address?
▪ IP/MAC address
mappings for some LAN
137.196.7.7 nodes:
8 < IP address; MAC address; TTL>
▪ TTL: time after which
1A-2F-BB-76-09-
137.196.7.2 AD
3 137.196.7.1 address mapping will be
4
forgotten (typically 20
LAN min)
71-65-F7-2B-08-
53 58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98
137.196.7.8
8

Link Layer 5-32


arp table – arp -a

Data Link Layer 5-33


ARP Operation
ARP Operation (cont.)
ARP Operation (cont.)
ARP Operation (cont.)
ARP Operation (cont.)
Addressing: routing to another LAN
walkthrough: send datagram from A to B via R
▪ focus on addressing – at IP (datagram) and MAC layer (frame)
▪ assume A knows B’s IP address
▪ assume A knows IP address of first hop router, R (how?)
▪ assume A knows R’s MAC address (how?)

A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-FF-
29-BD-D2-C7-56-
4
55
222.222.222.22 2A
1A-23-F9-CD-06-
0
9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0-AB- E6-E9-00-17-BB- 88-B2-2F-54-1A-
1
7D 4B 0F

Link Layer 5-39


Addressing: routing to another LAN
❖ A creates IP datagram with IP source A, destination B
❖ A creates link-layer frame with R's MAC address as dest, frame
contains A-to-B IP datagram
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-
4B IP src: 111.111.111.111
IP dest:
222.222.222.222
IP
Eth
Phy

A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-FF-
29-BD-D2-C7-56-
4
55
222.222.222.22 2A
1A-23-F9-CD-06-
0
9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0-AB- E6-E9-00-17-BB- 88-B2-2F-54-1A-
1
7D 4B 0F

Link Layer 5-40


Addressing: routing to another LAN
❖ frame sent from A to R
❖ frame received at R, datagram removed, passed up to IP

MAC src: 74-29-9C-E8-FF-55


MAC dest: E6-E9-00-17-BB-
IP src: 111.111.111.111
4B IP dest:
IP src: 111.111.111.111
IP dest: 222.222.222.222
222.222.222.222
IP IP
Eth Eth
Phy Phy

A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-FF-
29-BD-D2-C7-56-
4
55
222.222.222.22 2A
1A-23-F9-CD-06-
0
9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0-AB- E6-E9-00-17-BB- 88-B2-2F-54-1A-
1
7D 4B 0F

Link Layer 5-41


Addressing: routing to another LAN
❖ R forwards datagram with IP source A, destination B
❖ R creates link-layer frame with B's MAC address as dest, frame
contains A-to-B IP datagram

MAC src: 1A-23-F9-CD-06-9B


MAC dest: 49-BD-D2-C7-56-
2A IP src: 111.111.111.111
IP dest:
222.222.222.222 IP
IP Eth
Eth Phy
Phy

A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-FF-
29-BD-D2-C7-56-
4
55
222.222.222.22 2A
1A-23-F9-CD-06-
0
9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0-AB- E6-E9-00-17-BB- 88-B2-2F-54-1A-
1
7D 4B 0F

Link Layer 5-42


Addressing: routing to another LAN
❖ R forwards datagram with IP source A, destination B
❖ R creates link-layer frame with B's MAC address as dest, frame
contains A-to-B IP datagram
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-
2A IP src: 111.111.111.111
IP dest:
222.222.222.222
IP
Eth
Phy

A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-FF-
29-BD-D2-C7-56-
4
55
222.222.222.22 2A
1A-23-F9-CD-06-
0
9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0-AB- E6-E9-00-17-BB- 88-B2-2F-54-1A-
1
7D 4B 0F

Link Layer 5-43


MAC and IP
MAC Address
❖ This address does not change
❖ Similar to the name of a person
❖ Known as physical address because physically
assigned to the host NIC
IP Address
❖ Similar to the address of a person
❖ Based on where the host is actually located
❖ Known as a logical address because assigned
logically
❖ Assigned to each host by a network administrator
End-to-End Connectivity, MAC,
and IP
IP Packet Encapsulated in an Ethernet Frame
Link layer, LANs: outline
5.1 introduction, services 5.7 a day in the life of a
5.2 error detection, web request
correction
5.3 multiple access
protocols
5.4 LANs
▪ addressing, ARP
▪ Ethernet
▪ switches
▪ VLANS

Link Layer 5-46


LLC and MAC Sublayers
Ethernet
▪ One of the most widely used LAN technologies
▪ Operates in the data link layer and the physical layer
▪ Family of networking technologies defined in the IEEE
802.2 and 802.3 standards
▪ Supports data bandwidths of 10, 100, 1000, 10,000,
40,000, and 100,000 Mb/s (100 Gb/s)
Ethernet Standards
▪ Define Layer 2 protocols and Layer 1 technologies
▪ Two separate sub layers of the data link layer to operate –
Logical Link Control (LLC) and the MAC sublayers
LLC and MAC Sublayers (cont.)
Ethernet Frame

Preamble and Start Length/Type Field – Data and Pad


Frame Delimiter Fields Defines the exact length Fields –
– of the frame’s data field; Contains the
Used for describes which encapsulated data
synchronization protocol is from a higher layer;
between the sending implemented. an IPv4 packet.
and receiving devices.
802.3 Ethernet standards: link & physical layers

❖ many different Ethernet standards


▪ they have common MAC protocol and frame format
▪ different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps,
10G bps
▪ different physical layer media: fiber, cable

MAC protocol
application and frame format
transport
network 100BASE-TX 100BASE-T2 100BASE-FX
link 100BASE-T4 100BASE-SX 100BASE-BX
physical

copper (twister fiber physical layer


pair) physical layer
Link Layer 5-50
❖ The first part refers to the speed of the standard: 10,
100, 1000, or 10G, for 10 Mbps, 100 Mb, Gb, and 10
Gb Ethernet, respectively.
❖ “BASE” refers to baseband Ethernet, meaning that the
physical media only carries Ethernet traffic;
▪ Almost all of the 802.3 standards are for baseband Ethernet.
❖ The final part of the acronym refers to the physical
media itself;
▪ Ethernet is both a link-layer and a physical-layer
specification.
▪ It is carried over a variety of physical media including
coaxial cable, copper wire, and fiber.
❖ Generally, a “T” refers to twisted-pair copper wires.

5-51
Link layer, LANs: outline
5.1 introduction, services 5.7 a day in the life of a
5.2 error detection, web request
correction
5.3 multiple access
protocols
5.4 LANs
▪ addressing, ARP
▪ Ethernet
▪ switches
▪ VLANS

Link Layer 5-52


Ethernet switch
❖ It’s a link-layer device: takes an active role
▪ store, forward Ethernet frames
▪ Performs switching and filtering based only on the
MAC address
▪ Builds a MAC address table that it uses to make
forwarding decisions
▪ Depends on routers to pass data between IP
subnetworks
❖ transparent
▪ hosts are unaware of presence of switches
❖ plug-and-play, self-learning
▪ switches do not need to be configured
▪ Table is built automatically, dynamically, and autonomously –
without any intervention from a network admin or from a
configuration protocol. Link Layer 5-53
Switch: multiple simultaneous transmissions
❖ hosts have dedicated, direct A
connection to switch
C’ B
❖ switches buffer packets
❖ Ethernet protocol used on each 6 1 2
incoming link, but no collisions;
❖ Switches are full duplex – any 5 4 3
switch interface can send and
receive at the same time. B’ C

▪ each link is its own collision


domain A’
❖ switching: A-to-A’ and B-to-B’ switch with six interfaces
can transmit simultaneously, (1,2,3,4,5,6)
without collisions

Link Layer 5-54


Switch forwarding table
A
Q: how does switch know A’
reachable via interface 4, B’ C’ B
reachable via interface 5? 1
6 2
❖ A: each switch has a switch
table, each entry: 5 4 3

▪ (MAC address of host, interface B’ C


to reach host, time stamp)
▪ looks like a routing table! A’
Q: how are entries created, switch with six interfaces
maintained in switch table? (1,2,3,4,5,6)
▪ something like a routing
protocol?
Link Layer 5-55
Switch: self-learning Source: A
Dest: A’

A A A’
❖ A switch learns which
hosts can be reached B
C’
through which interfaces
▪ when frame received, 6 1 2
switch “learns”
location of sender: 5 4 3
incoming LAN segment
▪ records sender/location B’ C
pair in switch table
A’

MAC addr interface TTL


A 1 60 Switch table
(initially empty)

Link Layer 5-56


Switch: frame filtering/forwarding
when frame received at switch:

1. record incoming link, MAC address of sending host


2. index switch table using MAC destination address
3. if entry found for destination
then {
if destination on segment from which frame arrived
then drop frame
else forward frame on interface indicated by entry
}
else flood /* forward on all interfaces except arriving
interface */

Link Layer 5-57


Self-learning, forwarding: example Source: A
Dest: A’

A A A’
❖ frame destination, A’,
B
location unknown: flood C’

1
❖ destination A location 6 2

known: selectively send A A’


5 4 3

on just one link B’ C


A’ A

A’

MAC addr interface TTL


A 1 60 switch table
A’ 4 60 (initially empty)

Link Layer 5-58


Interconnecting switches
❖ switches can be connected together
S4

S1
S3
A S2
F
D I
B C
G H
E

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!)
Link Layer 5-59
Self-learning multi-switch example
Suppose C sends frame to I, I responds to C

S4

S1
S3
A S2
F
D I
B C
G H
E

❖ Q: show switch tables and packet forwarding in S1, S2, S3,


S4

Link Layer 5-60


Institutional network
mail server
to external
network
router web server

IP subnet

Link Layer 5-61


Switches vs. routers
application
transport
both are store-and-forward:
▪ routers: network-layer
datagram network
frame link
devices (examine network- physical link frame
layer headers) physical
▪ switches: link-layer devices
(examine link-layer switch
headers)
network datagram
both have forwarding tables: link frame
▪ routers: compute tables physical
using routing algorithms, IP application
addresses transport
▪ switches: learn forwarding network
table using flooding, link
learning, MAC addresses physical

Link Layer 5-62


Virtual Local Area Networks (VLANs)
▪ Lack of traffic isolation.
All broadcast traffic must
still traverse entire LAN.
Limiting scope of such
broadcast traffic would
improve LAN performance.
• It’d also enhance security/
privacy & efficiency
▪ Inefficient use of switches.
If instead of 3 groups, the
❖ The config in fig is institution had 10 groups,
hierarchical for modern 10 first-level switches
institution LANs but would be required. Single
switch can’t provide traffic
has some drawbacks: isolation.

5-63
VLANs: motivation
❖ Managing users. If CS user
moves office to SE, but
wants to connect to CS
switch, the physical
cabling must be changed to
connect the user to a
different switch.
❖ Fortunately, each of these
Computer
Computer difficulties can be handled
Science Software
Engineering
Engineering by a switch that supports
VLANs

Link Layer 5-64


port-based VLAN: switch ports
VLANs grouped (by switch management
software) so that single physical
switch ……
Virtual Local
1 7 9 15
Area Network 2 8 10 16

switch(es) supporting
VLAN capabilities can … …
be configured to Software Engineering Computer
define multiple virtual (VLAN ports 1-8) Science
(VLAN ports 9-15)
LANS over single … operates as multiple virtual switches
physical LAN
infrastructure. 1 7 9 15
2 8 10 16

… …

Software Engineering Computer


(VLAN ports 1-8) Science
(VLAN ports 9-16)
Link Layer 5-65
Port-based VLAN
router
❖ traffic isolation: frames
to/from ports 1-8 can only
reach ports 1-8
▪ can also define VLAN based on
MAC addresses of endpoints, rather
than switch port 1 7 9 15

2 8 10 16

❖ dynamic membership: ports


can be dynamically assigned … …
among VLANs Software Engineering Computer
(VLAN ports 1-8) Science
(VLAN ports 9-15)
❖ forwarding between VLANS: done
via routing (just as with separate
switches)
▪ in practice vendors sell combined
switches plus routers

Link Layer 5-66


VLANS spanning multiple switches

1 7 9 15 1 3 5 7

2 8 10 16 2 4 6 8

… …

Software Engineering Computer Ports 2,3,5 belong to SE VLAN


(VLAN ports 1-8) Science Ports 4,6,7,8 belong to CS
(VLAN ports 9-15) VLAN

❖ trunk port: carries frames between VLANS defined over


multiple physical switches
▪ frames forwarded within VLAN between switches can’t be vanilla
802.1 frames (must carry VLAN ID info)
▪ 802.1Q protocol adds/removes additional header fields for frames
forwarded between trunk ports

Link Layer 5-67


❖ The 802.1Q frame consists of the standard Ethernet
frame with a four-byte VLAN tag added into the header
that carries identity of VLAN to which frame belongs.
❖ VLAN tag is added into a frame by the switch at
sending side of a VLAN trunk, parsed, and removed by
the switch at the receiving side of the trunk.
❖ VLAN tag itself consists of:
▪ A 2-byte Tag Protocol Identifier (TPID) field (with a fixed
hexadecimal value of 81-00),
▪ A 2-byte Tag Control Information field that contains a 12-bit
VLAN identifier field, and a 3-bit priority field that is similar
in intent to the IP datagram TOS (Type of Service) field.

5-68
802.1Q VLAN frame format
type

preamble dest. source data (payload) CRC


address address 802.1 frame

type

dest. source
preamble
address address
data (payload) CRC 802.1Q frame

2-byte Tag Protocol Identifier Recomputed


(value: 81-00) CRC

Tag Control Information (12 bit VLAN ID field,


3 bit priority field like IP TOS)

Link Layer 5-69


Link layer, LANs: outline
5.1 introduction, services 5.7 a day in the life of a
5.2 error detection, web request
correction
5.3 multiple access
protocols
5.4 LANs
▪ addressing, ARP
▪ Ethernet
▪ switches
▪ VLANS

Link Layer 5-70


Synthesis: a day in the life of a web request
❖ journey down protocol stack complete!
▪ application, transport, network, link
❖ putting-it-all-together: synthesis!
▪ goal: identify, review, understand protocols (at all
layers) involved in seemingly simple scenario:
requesting www page
▪ scenario: student attaches laptop to campus network,
requests/receives www.google.com

Link Layer 5-71


A day in the life: scenario

browse DNS server


r
Comcast network
68.80.0.0/13

school network
68.80.2.0/24

web
page

web server Google’s network


64.233.169.105 64.233.160.0/19

Link Layer 5-72


A day in the life… connecting to the Internet
DHCP DHC ❖ connecting laptop needs to
P
DHCP
DHCP UDP
get its own IP address, addr
DHCP IP of first-hop router, addr of
Eth DNS server: use DHCP
Phy
DHCP

❖ DHCP request encapsulated


in UDP, encapsulated in IP,
DHC
DHCP
DHCP P
encapsulated in 802.3
DHCP UDP Ethernet
DHCP IP router
Eth (runs DHCP) ❖ Ethernet frame broadcast
Phy (dest: FFFFFFFFFFFF) on
LAN, received at router
running DHCP server
❖ Ethernet demuxed to IP
demuxed, UDP demuxed to
DHCP
Link Layer 5-73
A day in the life… connecting to the Internet
DHCP DHC ❖ DHCP server formulates
DHCP P DHCP ACK containing
DHCP UDP client’s IP address, IP
DHCP IP address of first-hop router
Eth for client, name & IP
Phy address of DNS server
❖ encapsulation at DHCP
DHCP DHC server, frame forwarded
DHCP P (switch learning) through
DHCP UDP LAN, demultiplexing at
DHCP IP router client
Eth (runs DHCP)
DHCP ❖ DHCP client receives
Phy
DHCP ACK reply

Client now has IP address, knows name & addr of


DNS
server, IP address of its first-hop router
Link Layer 5-74
A day in the life… ARP (before DNS, before HTTP)
DNS DNS ❖ before sending HTTP request, need
DNS UDP IP address of www.google.com:
DNS
ARP
IP DNS
ARP query Eth
Phy ❖ DNS query created, encapsulated in
UDP, encapsulated in IP,
encapsulated in Eth. To send frame
ARP
to router, need MAC address of
ARP reply Eth
Phy router interface: ARP
router ❖ ARP query broadcast, received by
(runs DHCP) router, which replies with ARP
reply giving MAC address of
router interface
❖ client now knows MAC address
of first hop router, so can now
send frame containing DNS
query
Link Layer 5-75
A day in the life… using DNS DNS
DNS UDP DNS server
DNS IP
DNS DNS DNS Eth
DNS UDP DNS Phy
DNS IP
DNS Eth
Phy
DNS
Comcast network
68.80.0.0/13

router ❖ IP datagram forwarded from


(runs DHCP) campus network into comcast
❖ IP datagram containing DNS network, routed (tables created by
query forwarded via LAN RIP, OSPF, IS-IS and/or BGP
switch from client to 1st hop routing protocols) to DNS server
router ❖ demux’ed to DNS server
❖ DNS server replies to client
with IP address of
www.google.com
Link Layer 5-76
A day in the life…TCP connection carrying HTTP
HTTP
HTTP
SYNACK
SYN TCP
SYNACK
SYN IP
SYNACK
SYN Eth
Phy

❖ to send HTTP request, client


first opens TCP socket to
web server
router ❖ TCP SYN segment (step 1 in 3-
(runs DHCP)
SYNACK
SYN TCP way handshake) inter-domain
SYNACK
SYN IP routed to web server
SYNACK
SYN Eth
Phy ❖ web server responds with TCP
SYNACK (step 2 in 3-way
web server handshake)
64.233.169.105 ❖ TCP connection established!

Link Layer 5-77


A day in the life… HTTP request/reply
HTTP
HTTP HTTP ❖ web page finally (!!!) displayed
HTTP
HTTP TCP
HTTP
HTTP IP
HTTP
HTTP Eth
Phy

❖ HTTP request sent into TCP


socket
router ❖ IP datagram containing HTTP
HTTP HTTP (runs DHCP)
HTTP TCP
request routed to
HTTP IP www.google.com
HTTP Eth ❖ web server responds with
Phy HTTP reply (containing web
page)
web server
64.233.169.105 ❖ IP datagram containing HTTP
reply routed back to client
Link Layer 5-78
Chapter 5: Summary
❖ principles behind data link layer services:
▪ error detection, correction
▪ sharing a broadcast channel: multiple access
▪ link layer addressing
❖ instantiation and implementation of various link
layer technologies
▪ Ethernet
▪ switched LANS, VLANs
▪ virtualized networks as a link layer: MPLS
❖ synthesis: a day in the life of a web request

Link Layer 5-79


Chapter 5: let’s take a breath
❖ journey down protocol stack complete (except
PHY)
❖ solid understanding of networking principles,
practice
❖ ….. could stop here …. but lots of interesting
topics!
▪ wireless
▪ multimedia
▪ security
▪ network management

Link Layer 5-80

You might also like