SlideShare a Scribd company logo
UNIT -5 The Link layer and Local
Area Networks
Link Layer 5-2
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection,
correction
5.3 multiple access
protocols
5.4 LANs
 addressing, ARP
 Ethernet
 switches
Link Layer 5-3
Link layer: introduction
terminology:
 hosts and routers: nodes
 communication channels that
connect adjacent nodes along
communication path: links
 wired links
 wireless links
 LANs
 layer-2 packet: frame,
encapsulates datagram
data-link layer has responsibility of
transferring datagram from one node
to physically adjacent node over a link
global ISP
Link Layer 5-4
Link layer: context
 datagram transferred by
different link protocols over
different links:
 e.g., Ethernet on first link,
frame relay on
intermediate links, 802.11
on last link
 each link protocol provides
different services
 e.g., may or may not
provide rdt over link
transportation analogy:
 trip from Princeton to Lausanne
 limo: Princeton to JFK
 plane: JFK to Geneva
 train: Geneva to Lausanne
 tourist = datagram
 transport segment =
communication link
 transportation mode = link
layer protocol
 travel agent = routing
algorithm
Link Layer 5-5
Link layer services
 framing, link access:
 encapsulate datagram into frame, adding header, trailer
 channel access if shared medium
 “MAC” addresses used in frame headers to identify
source, dest
• different from IP address!
 reliable delivery between adjacent nodes
 seldom used on low bit-error link (fiber, some twisted
pair)
 wireless links: high error rates
Link Layer 5-6
 flow control:
 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 services (more)
Link Layer 5-7
Where is the link layer implemented?
 in each and every host
 link layer implemented in
“adaptor” (aka network
interface card NIC) or on a
chip
 Ethernet card, 802.11
card; Ethernet chipset
 implements link, physical
layer
 attaches into host’s system
buses
 combination of hardware,
software, firmware
Link Layer 5-8
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection,
correction
5.3 multiple access
protocols
5.4 LANs
 addressing, ARP
 Ethernet
 switches
 VLANS
5.5 link virtualization:
MPLS
5.6 data center
networking
5.7 a day in the life of a
web request
Figure 9-1
Single-bit error
Figure 9-2
Multiple-bit error
Figure 9-3
Burst error
Figure 9-4
13
Error Detection
 Data transmission can contain errors
 Single-bit
 Burst errors of length n
(n: distance between the first and last errors in data
block)
 How to detect errors
 If only data is transmitted, errors cannot be detected
 Send more information with data that satisfies a
special relationship
 Add redundancy
Redundancy
Figure 9-5
Figure 9-6
16
Error Detection Methods
 Vertical Redundancy Check (VRC)
 Append a single bit at the end of data block such that
the number of ones is even
 Even Parity (odd parity is similar)
0110011  01100110
0110001  01100011
 VRC is also known as Parity Check
 Performance:
• Detects all odd-number errors in a data block
Winter 2005
ECE
ECE 766 17
Error Detection Methods
 Longitudinal Redundancy Check (LRC)
 Organize data into a table and create a parity for each
column
11100111 11011101 00111001 10101001
11100111
11011101
00111001
10101001
10101010
11100111 11011101 00111001 10101001 10101010
Original Data LRC
Winter 2005
ECE
ECE 766 18
Error Detection Methods
 Performance:
• Detects all burst errors up to length n
(number of columns)
• Misses burst errors of length n+1 if there are n-1 uninverted
bits between the first and last bit
• If the block is badly garbled, the probability of acceptance is
( )n
2
1
CRC
Figure 9-10
Binary Division
Figure 9-11
Polynomial
Figure 9-12
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Figure 9-13
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Polynomial and Divisor
Standard Polynomials
Figure 9-14
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Example-CRC
Data Link Layer 5-24
Checksum
Figure 9-15
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
• Used by upper layer protocols
• Similar to LRC, uses one’s complement arithmetic
Figure 9-16
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Data Unit and Checksum
Error Correction
Figure 9-17
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Hamming CodeFigure 9-18
Figure 9-19
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Hamming Code
Figure 9-19-continued
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Hamming Code
Figure 9-20
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Example of Hamming Code
Single-bit error
Figure 9-21
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Figure 9-22
WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
Error
Detection
Link Layer 5-34
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection,
correction
5.3 multiple access
protocols
5.4 LANs
 addressing, ARP
 Ethernet
 switches
 VLANS
Link Layer 5-35
Multiple access protocols
 It avoids two or more nodes from transmitting at
the same time over a broadcast channel.
 If different nodes send data at the same time
collisions occurs and the receiver will not be able
to understand the signal.
 Classes of MAP
 Partitioning the channel eg. FDM & TDM
 Taking turns eg. Token based, polling based &
reservation based
 Contention based protocol e.g. ALOHA and Ethernet
Link Layer 5-36
Multiple access protocols
Different multiple access protocols..
Random access protocols-
 channel not divided, allow collisions
 “recover” from collisions
Controlled access protocols-
 Nodes take turns, but nodes with more to send can
take longer turns.
Channelization protocols-
 divide channel into smaller “pieces” (time slots,
frequency, code)
 allocate piece to node for exclusive use
Link Layer 5-37
Multiple access protocols
 Different multiple access protocols..
 Random access protocols
 ALOHA
 CSMA
 CSMA/CD
 Controlled access protocols
 Reservation
 Polling
 Token passing
 Channelization protocols
 FDMA
 TDMA
Link Layer 5-38
Multiple access links,
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)
 old-fashioned Ethernet
 upstream HFC
 802.11 wireless LAN
shared wire (e.g.,
cabled Ethernet) (e.g., 802.11 WiFi)
Link Layer 5-39
An ideal multiple access protocol
given: broadcast channel of rate R bps
desiderata:
1. when one node wants to transmit, it can send at rate R.
2. when M nodes want to transmit, each can send at average
rate R/M
3. fully decentralized:
• no special node to coordinate transmissions
• no synchronization of clocks, slots
4. simple
Link Layer 5-40
Channel partitioning MAC protocols: TDMA
TDMA: time division multiple access
 access to channel in "rounds"
 each station gets fixed length slot (length = pkt
trans time) in each round
 unused slots go idle
 example: 6-station LAN, 1,3,4 have pkt, slots
2,5,6 idle
1 3 4 1 3 4
6-slot
frame
6-slot
frame
Link Layer 5-41
FDMA: frequency division multiple access
 channel spectrum divided into frequency bands
 each station assigned fixed frequency band
 unused transmission time in frequency bands go idle
 example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6
idle
frequencybands
time
FDM cable
Channel partitioning MAC protocols: FDMA
Link Layer 5-42
Random access protocols
 when node has packet to send
 transmit at full channel data rate R.
 no a priori coordination among nodes
 two or more transmitting nodes ➜ “collision”,
 random access MAC protocol specifies:
 how to detect collisions
 how to recover from collisions (e.g., via delayed
retransmissions)
 examples of random access MAC protocols:
 Pure (Unslotted )ALOHA
 slotted ALOHA
 CSMA, CSMA/CD, CSMA/CA
Link Layer 5-43
ALOHA
 It signifies a simple communications schemes in
which each transmitter within a network sends
data whenever there is a frame to send.
 Next frame is sent only if the previous frame
successfully reaches the destination.
 If frame fails to reach at the destination , it is sent
again.
 Types of ALOHA
 Pure ALOHA
 Slotted ALOHA
Link Layer 5-44
Pure (unslotted) ALOHA
 unslotted Aloha: simpler, no synchronization
 when frame first arrives
 transmit immediately
 collision probability increases:
 frame sent at t0 collides with other frames sent in [t0-1,t0+1]
Link Layer 5-45
Pure (unslotted) ALOHA
 unslotted Aloha: simpler, no synchronization
 when frame first arrives
 transmit immediately
 collision probability increases:
 frame sent at t0 collides with other frames sent in [t0-1,t0+1]
Link Layer 5-46
Pure ALOHA efficiency
P(success by given node) = P(node transmits) .
P(no other node transmits in [t0-1,t0] .
P(no other node transmits in [t0-1,t0]
= p . (1-p)N-1 . (1-p)N-1
= p . (1-p)2(N-1)
… choosing optimum p and then letting n
= 1/(2e) = .18
Link Layer 5-47
Slotted ALOHA
assumptions:
 all frames same size
 time divided into equal size
slots (time to transmit 1
frame)
 nodes start to transmit
only slot beginning
 nodes are synchronized
 if 2 or more nodes transmit
in slot, all nodes detect
collision
operation:
 when node obtains fresh
frame, transmits in next slot
 if no collision: node can send
new frame in next slot
 if collision: node retransmits
frame in each subsequent
slot with prob. p until
success
Link Layer 5-48
Pros:
 single active node can
continuously transmit at
full rate of channel
 highly decentralized: only
slots in nodes need to be
in sync
 simple
Cons:
 collisions, wasting slots
 idle slots
 nodes may be able to
detect collision in less
than time to transmit
packet
 clock synchronization
Slotted ALOHA
1 1 1 1
2
3
2 2
3 3
node 1
node 2
node 3
C C CS S SE E E
Link Layer 5-49
 suppose: N nodes with
many frames to send,
each transmits in slot with
probability p
 prob that given node has
success in a slot = p(1-p)N-
1
 prob that any node has a
success = Np(1-p)N-1
 max efficiency: find p* that
maximizes
Np(1-p)N-1
 for many nodes, take limit
of Np*(1-p*)N-1
as N goes
to infinity, gives:
max efficiency = 1/e = .37
efficiency: long-run
fraction of successful slots
(many nodes, all with many
frames to send)
at best: channel
used for useful
transmissions 37%
of time! !
Slotted ALOHA: efficiency
Link Layer 5-50
CSMA (carrier sense multiple access)
CSMA: listen before transmit:
if channel sensed idle: transmit entire frame
 if channel sensed busy, defer transmission
 human analogy: don’t interrupt others!
Link Layer 5-51
CSMA (carrier sense multiple access)
• Non-persistent CSMA
• 1-persistent CSMA
• P-persistent CSMA
Link Layer 5-52
CSMA (carrier sense multiple access)
• Non-persistent CSMA
• In this , if a station wants to transmit a frame and it
finds that the channel is busy then it will wait for fixed
interval of time.
• After some time ,it again checks the status of the
channel
• If channel is free it will transmit
• 1-persistent CSMA
• P-persistent CSMA
Link Layer 5-53
CSMA (carrier sense multiple access)
• Non-persistent CSMA
• 1-persistent CSMA
• The station which wants to transmit , continuously
monitors the channel until it is idle and then transmits
immediately.
• If two are waiting then they will transmit
simultaneously and collision take place then require
retransmission
• P-persistent CSMA
Link Layer 5-54
CSMA (carrier sense multiple access)
• Non-persistent CSMA
• 1-persistent CSMA
• P-persistent CSMA
• All the waiting stations are not allowed to transmit
simultaneously as soon as the channel become idle
• Possibility of collision and retransmission is reduced
• A station is assumed to be transmitted with a
probability p
Link Layer 5-55
CSMA/CD (collision detection)
Link Layer 5-56
CSMA/CD (collision detection)
CSMA/CD: carrier sensing, deferral as in CSMA
 collisions detected within short time
 colliding transmissions aborted, reducing channel wastage
 collision detection:
 easy in wired LANs: measure signal strengths, compare
transmitted, received signals
 difficult in wireless LANs: received signal strength
overwhelmed by local transmission strength
 human analogy: the polite conversationalist
Link Layer 5-57
CSMA/CD (procedure)
Link Layer 5-58
CSMA/CD efficiency
 Tprop = max prop delay between 2 nodes in LAN
 ttrans = time to transmit max-size frame
so ttrans >= 2Tprop
iL/R>=2*D/S
L>=2DR/S so of less than frame length then
collision detection mechanism not
possible
 efficiency goes to 1
 as tprop goes to 0
 as ttrans goes to infinity
transprop /tt
efficiency
51
1
+
=
 Station ready to transmit, senses the the line by
using one of persistent technique.
 As soon as it find the line to be idle , the station
waits for a time equal to an IFG(Interframe Gap).
 It then wait for some random time and sends the
frame.
 After sending the frame . It sets a timer and waits
for the ack from the receiver.
 If the ack is received before expiry of the timer ,
then the transmitter is successful.
 But if the transmitting station does not receive
the expected ack before the timer expiry then
the increments the back off parameter , waits for
the back off time and senses the line again.
Data Link Layer 5-59
CSMA/CA (Collision Avoidance)
Data Link Layer 5-60
CSMA/CA (Collision Avoidance)
Link Layer 5-61
Multiple access protocols
 Different multiple access protocols..
 Random access protocols
 ALOHA
 CSMA
 CSMA/CD
 Controlled access protocols
 Polling
 Token passing
 Channelization protocols
 FDMA
 TDMA
Link Layer 5-62
• It requires one of the nodes to be designated as
a master node.
• The master node polls each of the nodes in a
round-robin fashion.
• the master node first sends a message to node
1, saying that it (node 1) can transmit up to
some maximum number of frames.
• After node 1 transmits some frames, the master
node tells node 2 it (node 2) can transmit up to
the maximum number of frames.
Controlled access protocols-Polling
Link Layer 5-63
• The master node can determine when a node has
finished sending its frames by observing the lack
of a signal on the channel.
 The procedure continues in this manner, with the
master node polling each of the nodes in a cyclic
manner.
 It eliminates the collisions and allows polling to
achieve a much higher efficiency
Controlled access protocols-Polling
master
slaves
poll
data
data
Link Layer 5-64
Disadvantage -
•Polling delay—the amount of time required to notify
a node that it can transmit.
•if the master node fails, the entire channel becomes
inoperative.
Controlled access protocols-Polling
5-65
 In this protocol there is
no master node.
 A small, special-purpose
frame known as a token
is exchanged among the
nodes in some fixed
order.
 When a node receives a
token, it holds onto the
token only if it has some
frames to transmit
otherwise, it immediately
forwards the token to
the next node.
Controlled access protocols-Token Passing
T
data
(nothing
to send)
T
Link Layer 5-66
• If a node does have frames to transmit when it
receives the token, it sends up to a maximum
number of frames and then forwards the token
to the next node.
• It is decentralized and highly efficient.
Disadvantage-
 The failure of one node can crash the entire
channel.
 if a node accidentally neglects to release the
token, then some recovery procedure must be
invoked to get the token back in circulation.
Controlled access protocols-Token Passing
Link Layer 5-67
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection,
correction
5.3 multiple access
protocols
5.4 LANs
 addressing, ARP
 Ethernet
 switches
 VLANS
Link Layer 5-68
MAC addresses and ARP
 32-bit IP address:
 network-layer address for interface
 used for layer 3 (network layer) forwarding
 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-69
LAN addresses and ARP
each adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
(wired or
wireless)
Link Layer 5-70
LAN addresses (more)
 MAC address allocation administered by IEEE
 manufacturer buys portion of MAC address space
(to assure uniqueness)
 analogy:
 MAC address: like Social Security Number
 IP address: like postal address
 MAC flat address ➜ portability
 can move LAN card from one LAN to another
 IP hierarchical address not portable
 address depends on IP subnet to which node is
attached
Link Layer 5-71
ARP: address resolution protocol
ARP table: each IP node (host,
router) on LAN has table
 IP/MAC address
mappings for some LAN
nodes:
< IP address; MAC address; TTL>
 TTL (Time To Live):
time after which address
mapping will be
forgotten (typically 20
min)
Question: how to determine
interface’s MAC address,
knowing its IP address?
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137.196.7.23
137.196.7.78
137.196.7.14
137.196.7.88
Link Layer 5-72
ARP protocol: same LAN
 A wants to send datagram
to B
 B’s MAC address not in A’s
ARP table.
 A broadcasts ARP query
packet, containing B's IP
address
 dest MAC address = FF-FF-
FF-FF-FF-FF
 all nodes 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)
 soft state: information that
times out (goes away)
unless refreshed
 ARP is “plug-and-play”:
 nodes create their ARP
tables without intervention
from net administrator
Link Layer 5-73
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
 assume A knows R’s MAC address
Addressing: routing to another LAN
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-74
Addressing: routing to another LAN
IP
Eth
Phy
IP src: 111.111.111.111
IP dest: 222.222.222.222
 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
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-75
Addressing: routing to another LAN
IP
Eth
Phy
 frame sent from A to R
IP
Eth
Phy
 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-4B
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP src: 111.111.111.111
IP dest: 222.222.222.222
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-76
Addressing: routing to another LAN
IP src: 111.111.111.111
IP dest: 222.222.222.222
 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
Eth
Phy
IP
Eth
Phy
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-77
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
IP src: 111.111.111.111
IP dest: 222.222.222.222
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP
Eth
Phy
IP
Eth
Phy
R
1A-23-F9-CD-06-9B
222.222.222.220
111.111.111.110
E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D
111.111.111.112
111.111.111.111
74-29-9C-E8-FF-55
A
222.222.222.222
49-BD-D2-C7-56-2A
222.222.222.221
88-B2-2F-54-1A-0F
B
Link Layer 5-78
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
IP src: 111.111.111.111
IP dest: 222.222.222.222
MAC src: 1A-23-F9-CD-06-9B
MAC dest: 49-BD-D2-C7-56-2A
IP
Eth
Phy
Link Layer 5-79
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection,
correction
5.3 multiple access
protocols
5.4 LANs
 addressing, ARP
 Ethernet
 switches
Link Layer 5-80
Ethernet 802.3
• IEEE 802.3 (CSMA/CD - Ethernet) standard –
originally 2Mbps
• IEEE 802.3u standard for 100Mbps Ethernet
• IEEE 802.3z standard for 1,000Mbps Ethernet
 Most popular packet-switched LAN technology
 Bandwidths: 10Mbps, 100Mbps, 1Gbps
 Max bus length: 2500m
 500m segments with 4 repeaters
 Bus and Star topologies are used to connect host.
 For transmission 802.3 LAN , it make use of 1-
persistant CSMA/CD protocol.
 When collision they wait for random time, to
select random time Ethernet use Binary
Exponential Backoff Algo
Link Layer 5-81
Ethernet CSMA/CD algorithm
1. NIC receives datagram
from network layer,
creates frame
2. If NIC senses channel
idle, starts frame
transmission. If NIC
senses channel busy,
waits until channel idle,
then transmits.
3. If NIC transmits entire
frame without detecting
another transmission,
NIC is done with frame !
4. If NIC detects another
transmission while
transmitting, aborts and
sends jam signal
5. After aborting, NIC
enters binary (exponential)
backoff:
 after mth collision, NIC
chooses K at random
from {0,1,2, …, 2m
-1}.
NIC waits K·512 bit
times, returns to Step 2
 longer backoff interval
with more collisions
Link Layer 5-82
Ethernet frame structure
sending adapter encapsulates IP datagram (or other
network layer protocol packet) in Ethernet frame
preamble:
 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
 used to synchronize receiver, sender clock rates
dest.
address
source
address
data
(payload) CRCpreamble
type
CS 640 83
Ethernet Frames
 Preamble is a sequence of 7 bytes, each set to “10101010”
 Used to synchronize receiver before actual data is sent
 Addresses
 unique, 48-bit unicast address assigned to each adapter
• example: 8:0:e4:b1:2
• Each manufacturer gets their own address range
 broadcast: all 1s
 multicast: first bit is 1
 Type field is a demultiplexing key used to determine which
higher level protocol the frame should be delivered to
 Body can contain up to 1500 bytes of data
Link Layer 5-84
Ethernet frame structure (more)
 addresses: 6 byte source, destination MAC addresses
 if adapter receives frame with matching destination
address, or with broadcast address (e.g. ARP packet), it
passes data in frame to network layer protocol
 otherwise, adapter discards frame
 type: indicates higher layer protocol key (mostly IP
but others possible)
 CRC: cyclic redundancy check at receiver
 error detected: frame is dropped
dest.
address
source
address
data
(payload) CRCpreamble
type
Link Layer 5-85
Ethernet: physical topology
 bus:
 all nodes in same collision domain (can collide with each
other)
 star: prevails today
 active switch in center
 each “spoke” runs a (separate) Ethernet protocol (nodes
do not collide with each other)
switch
bus: coaxial cable
star
CS 640 86
Ethernet Technologies: 10Base2
 10: 10Mbps; 2: under 185 (~200) meters cable length
 Thin coaxial cable in a bus topology
CS 640 87
10BaseT and 100BaseT
 10/100 Mbps rate
 T stands for Twisted Pair
 Hub(s) connected by twisted pair facilitate “star topology”
 Distance of any node to hub must be < 100M
CS 640 88
Physical Layer Configurations for 802.3
 Physical layer configurations are specified in three parts
 Data rate (10, 100, 1,000)
 10, 100, 1,000Mbps
 Signaling method (base, broad)
 Baseband
• Digital signaling
 Broadband
• Analog signaling
 Cabling (2, 5, T, F, S, L)
 5 - Thick coax (original Ethernet cabling)
 F – Optical fiber
 S – Short wave laser over multimode fiber
 L – Long wave laser over single mode fiber
CS 640 89
Fast and Gigabit Ethernet
 Fast Ethernet (100Mbps) has technology very similar to
10Mbps Ethernet
 Uses different physical layer encoding (4B5B)
 Many NIC’s are 10/100 capable
• Can be used at either speed
 Gigabit Ethernet (1,000Mbps)
 Compatible with lower speeds
 Uses standard framing and CSMA/CD algorithm
 Distances are severely limited
 Typically used for backbones and inter-router connectivity
 Becoming cost competitive
 How much of this bandwidth is realizable?
CS 640 90
Experiences with Ethernet
 Ethernets work best under light loads
 Utilization over 30% is considered heavy
• Network capacity is wasted by collisions
 Most networks are limited to about 200 hosts
 Specification allows for up to 1024
 Most networks are much shorter
 5 to 10 microsecond RTT
Link Layer 5-91
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection,
correction
5.3 multiple access
protocols
5.4 LANs
 addressing, ARP
 Ethernet
 switches
Switch
 Device that channels incoming data from any of
multiple input ports to the specific output port.
Example-traditional telephone network.
 In Internet, a switch determines from the IP
address in each packet which output port to use
for the next part of its trip to the intended
destination.
Link Layer 5-93
Ethernet switch
 link-layer device: takes an active role
 store, forward Ethernet frames
 examine incoming frame’s MAC address,
selectively forward frame to one-or-more
outgoing links when frame is to be forwarded on
segment, uses CSMA/CD to access segment
 transparent
 hosts are unaware of presence of switches
 plug-and-play, self-learning
 switches do not need to be configured
Link Layer 5-94
Switch: multiple simultaneous transmissions
 hosts have dedicated, direct
connection to switch
 switches buffer packets
 Ethernet protocol used on each
incoming link, but no collisions;
full duplex
 each link is its own collision
domain
 switching: A-to-A’ and B-to-B’
can transmit simultaneously,
without collisions switch with six interfaces
(1,2,3,4,5,6)
A
A’
B
B’ C
C’
1 2
345
6
Link Layer 5-95
Switch forwarding table
Q: how does switch know A’
reachable via interface 4, B’
reachable via interface 5?
switch with six interfaces
(1,2,3,4,5,6)
A
A’
B
B’ C
C’
1 2
345
6 A: each switch has a switch
table, each entry:
 (MAC address of host, interface to
reach host, time stamp)
 looks like a routing table!
Q: how are entries created,
maintained in switch table?
 something like a routing protocol?
A
A’
B
B’ C
C’
1 2
345
6
Link Layer 5-96
Switch: self-learning
 switch learns which hosts
can be reached through
which interfaces
 when frame received,
switch “learns”
location of sender:
incoming LAN segment
 records sender/location
pair in switch table
A A’
Source: A
Dest: A’
MAC addr interface TTL
Switch table
(initially empty)
A 1 60
Link Layer 5-97
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 */
A
A’
B
B’ C
C’
1 2
345
6
Link Layer 5-98
Self-learning, forwarding: example
A A’
Source: A
Dest: A’
MAC addr interface TTL
switch table
(initially empty)
A 1 60
A A’A A’A A’A A’A A’
 frame destination, A’,
locaton unknown: flood
A’ A
 destination A location
known:
A’ 4 60
selectively send
on just one link
Link Layer 5-99
Interconnecting switches
 switches can be connected together
Q: sending from A to G - how does S1 know to
forward frame destined to F via S4 and S3?
A: self learning! (works exactly the same as in single-
switch case!)
A
B
S1
C D
E
F
S2
S4
S3
H
I
G
Link Layer5-100
Self-learning multi-switch example
Suppose C sends frame to I, I responds to C
 Q: show switch tables and packet forwarding in S1, S2, S3,
S4
A
B
S1
C D
E
F
S2
S4
S3
H
I
G
Link Layer5-101
Institutional network
to external
network
router
IP subnet
mail server
web server
Link Layer5-102
Switches vs. routers
both are store-and-forward:
routers: network-layer
devices (examine network-
layer headers)
switches: link-layer devices
(examine link-layer headers)
both have forwarding tables:
routers: compute tables using
routing algorithms, IP
addresses
switches: learn forwarding
table using flooding, learning,
MAC addresses
application
transport
network
link
physical
network
link
physical
link
physical
switch
datagram
application
transport
network
link
physical
frame
frame
frame
datagram

More Related Content

What's hot

Network Layer
Network LayerNetwork Layer
Network Layer
Rutwik Jadhav
 
Unit 3 - Data Link Layer - Part B
Unit 3 - Data Link Layer - Part BUnit 3 - Data Link Layer - Part B
Unit 3 - Data Link Layer - Part B
Chandan Gupta Bhagat
 
Lec6
Lec6Lec6
Lec6
amrnaser3
 
Multi-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and ApplicationsMulti-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and Applications
Vishal Sharma, Ph.D.
 
Chapter3 transport layer
Chapter3 transport layerChapter3 transport layer
Chapter3 transport layer
Khánh Ghẻ
 
Lecture 3 network layer
Lecture 3 network layerLecture 3 network layer
Lecture 3 network layer
Ronoh Kennedy
 
A day in the life of a Web Request
A day in the life of a Web RequestA day in the life of a Web Request
A day in the life of a Web Request
MD.ANISUR RAHMAN
 
Network layer
Network layerNetwork layer
Network layer
Hasib Shaikh
 
Point-to-Point Protocol(PPP) CCN ppt
Point-to-Point Protocol(PPP) CCN pptPoint-to-Point Protocol(PPP) CCN ppt
Point-to-Point Protocol(PPP) CCN ppt
Niaz Shaikh
 
Mpls Services
Mpls ServicesMpls Services
Mpls Services
Kristof De Brouwer
 
Chapter4 Network
Chapter4 NetworkChapter4 Network
Chapter4 Network
Diego Corrales
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
Kathirvel Ayyaswamy
 
Introduction to PPP
Introduction to PPPIntroduction to PPP
Introduction to PPP
Frank Fang Kuo Yu
 
Chapter4 network layer
Chapter4 network layerChapter4 network layer
Chapter4 network layer
Khánh Ghẻ
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Dr. SELVAGANESAN S
 
Chapter 5 - Computer Networking a top-down Approach 7th
Chapter 5 - Computer Networking a top-down Approach 7thChapter 5 - Computer Networking a top-down Approach 7th
Chapter 5 - Computer Networking a top-down Approach 7th
Andy Juan Sarango Veliz
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
Mohd Arif
 
MPLS Deployment Chapter 2 - Services
MPLS Deployment Chapter 2 - ServicesMPLS Deployment Chapter 2 - Services
MPLS Deployment Chapter 2 - Services
Ericsson
 
Chapter3 transport
Chapter3 transportChapter3 transport
Chapter3 transport
Diego Corrales
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
Kathirvel Ayyaswamy
 

What's hot (20)

Network Layer
Network LayerNetwork Layer
Network Layer
 
Unit 3 - Data Link Layer - Part B
Unit 3 - Data Link Layer - Part BUnit 3 - Data Link Layer - Part B
Unit 3 - Data Link Layer - Part B
 
Lec6
Lec6Lec6
Lec6
 
Multi-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and ApplicationsMulti-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and Applications
 
Chapter3 transport layer
Chapter3 transport layerChapter3 transport layer
Chapter3 transport layer
 
Lecture 3 network layer
Lecture 3 network layerLecture 3 network layer
Lecture 3 network layer
 
A day in the life of a Web Request
A day in the life of a Web RequestA day in the life of a Web Request
A day in the life of a Web Request
 
Network layer
Network layerNetwork layer
Network layer
 
Point-to-Point Protocol(PPP) CCN ppt
Point-to-Point Protocol(PPP) CCN pptPoint-to-Point Protocol(PPP) CCN ppt
Point-to-Point Protocol(PPP) CCN ppt
 
Mpls Services
Mpls ServicesMpls Services
Mpls Services
 
Chapter4 Network
Chapter4 NetworkChapter4 Network
Chapter4 Network
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
 
Introduction to PPP
Introduction to PPPIntroduction to PPP
Introduction to PPP
 
Chapter4 network layer
Chapter4 network layerChapter4 network layer
Chapter4 network layer
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
Chapter 5 - Computer Networking a top-down Approach 7th
Chapter 5 - Computer Networking a top-down Approach 7thChapter 5 - Computer Networking a top-down Approach 7th
Chapter 5 - Computer Networking a top-down Approach 7th
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
MPLS Deployment Chapter 2 - Services
MPLS Deployment Chapter 2 - ServicesMPLS Deployment Chapter 2 - Services
MPLS Deployment Chapter 2 - Services
 
Chapter3 transport
Chapter3 transportChapter3 transport
Chapter3 transport
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
 

Similar to Chapter 5 my_ppt

Ch 5- link layer in lan
Ch 5- link layer in lanCh 5- link layer in lan
Ch 5- link layer in lan
sufi1248
 
Chapter_5_CN Link Layer.ppt
Chapter_5_CN Link Layer.pptChapter_5_CN Link Layer.ppt
Chapter_5_CN Link Layer.ppt
k191469ZohaMobin
 
Data centers architecture and design guide
Data centers architecture and design guideData centers architecture and design guide
Data centers architecture and design guide
MattPeci
 
Datacenters.pptx
Datacenters.pptxDatacenters.pptx
Datacenters.pptx
Ali Fraz Khan
 
Chapter 5 v6.01
Chapter 5 v6.01Chapter 5 v6.01
Chapter 5 v6.01
Savvas Dimopoulos
 
link layer
link layerlink layer
link layer
GS Kosta
 
Link layer
Link layerLink layer
Link layer
Belete Kidane
 
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptxLecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
HanzlaNaveed1
 
Medium Access PROTOCOL b yENGR. FAWAD KHAN UET BANNU KP PAKISTAN
Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTANMedium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN
Medium Access PROTOCOL b yENGR. FAWAD KHAN UET BANNU KP PAKISTAN
irfan sami
 
Internetworking devices
Internetworking devicesInternetworking devices
Internetworking devices
A Singh
 
Link layer.ppt
Link layer.pptLink layer.ppt
Link layer.ppt
Vinodkumar428053
 
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerIntroduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
VNIT-ACM Student Chapter
 
High speed Networking
High speed NetworkingHigh speed Networking
High speed Networking
sdb2002
 
Chapter_6_V7.01-modified (2).pptx
Chapter_6_V7.01-modified (2).pptxChapter_6_V7.01-modified (2).pptx
Chapter_6_V7.01-modified (2).pptx
udithaisur
 
Chapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7thChapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7th
Andy Juan Sarango Veliz
 
MAC seminar
MAC seminarMAC seminar
MAC seminar
Mridula Sharma
 
Chapeter 2
Chapeter 2Chapeter 2
Chapeter 2
Nazir Ahmed
 
Lecture2 mac learning
Lecture2 mac learningLecture2 mac learning
Lecture2 mac learning
denizgurkan_UH
 
Lecture 22 What inside the Router.pptx
Lecture 22 What inside the Router.pptxLecture 22 What inside the Router.pptx
Lecture 22 What inside the Router.pptx
HanzlaNaveed1
 
Lecture24
Lecture24Lecture24
Lecture24
Hira Imtiaz
 

Similar to Chapter 5 my_ppt (20)

Ch 5- link layer in lan
Ch 5- link layer in lanCh 5- link layer in lan
Ch 5- link layer in lan
 
Chapter_5_CN Link Layer.ppt
Chapter_5_CN Link Layer.pptChapter_5_CN Link Layer.ppt
Chapter_5_CN Link Layer.ppt
 
Data centers architecture and design guide
Data centers architecture and design guideData centers architecture and design guide
Data centers architecture and design guide
 
Datacenters.pptx
Datacenters.pptxDatacenters.pptx
Datacenters.pptx
 
Chapter 5 v6.01
Chapter 5 v6.01Chapter 5 v6.01
Chapter 5 v6.01
 
link layer
link layerlink layer
link layer
 
Link layer
Link layerLink layer
Link layer
 
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptxLecture 25 Link Layer - Error detection and Multiple Access.pptx
Lecture 25 Link Layer - Error detection and Multiple Access.pptx
 
Medium Access PROTOCOL b yENGR. FAWAD KHAN UET BANNU KP PAKISTAN
Medium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTANMedium Access PROTOCOL b yENGR.  FAWAD KHAN UET BANNU KP PAKISTAN
Medium Access PROTOCOL b yENGR. FAWAD KHAN UET BANNU KP PAKISTAN
 
Internetworking devices
Internetworking devicesInternetworking devices
Internetworking devices
 
Link layer.ppt
Link layer.pptLink layer.ppt
Link layer.ppt
 
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerIntroduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
 
High speed Networking
High speed NetworkingHigh speed Networking
High speed Networking
 
Chapter_6_V7.01-modified (2).pptx
Chapter_6_V7.01-modified (2).pptxChapter_6_V7.01-modified (2).pptx
Chapter_6_V7.01-modified (2).pptx
 
Chapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7thChapter 6 - Computer Networking a top-down Approach 7th
Chapter 6 - Computer Networking a top-down Approach 7th
 
MAC seminar
MAC seminarMAC seminar
MAC seminar
 
Chapeter 2
Chapeter 2Chapeter 2
Chapeter 2
 
Lecture2 mac learning
Lecture2 mac learningLecture2 mac learning
Lecture2 mac learning
 
Lecture 22 What inside the Router.pptx
Lecture 22 What inside the Router.pptxLecture 22 What inside the Router.pptx
Lecture 22 What inside the Router.pptx
 
Lecture24
Lecture24Lecture24
Lecture24
 

Recently uploaded

Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
nikshimanasa
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Massimo Talia
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
PreethaV16
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
snaprevwdev
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
VanTuDuong1
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 

Recently uploaded (20)

Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 

Chapter 5 my_ppt

  • 1. UNIT -5 The Link layer and Local Area Networks
  • 2. Link Layer 5-2 Link layer, LANs: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing, ARP  Ethernet  switches
  • 3. Link Layer 5-3 Link layer: introduction terminology:  hosts and routers: nodes  communication channels that connect adjacent nodes along communication path: links  wired links  wireless links  LANs  layer-2 packet: frame, encapsulates datagram data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link global ISP
  • 4. Link Layer 5-4 Link layer: context  datagram transferred by different link protocols over different links:  e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link  each link protocol provides different services  e.g., may or may not provide rdt over link transportation analogy:  trip from Princeton to Lausanne  limo: Princeton to JFK  plane: JFK to Geneva  train: Geneva to Lausanne  tourist = datagram  transport segment = communication link  transportation mode = link layer protocol  travel agent = routing algorithm
  • 5. Link Layer 5-5 Link layer services  framing, link access:  encapsulate datagram into frame, adding header, trailer  channel access if shared medium  “MAC” addresses used in frame headers to identify source, dest • different from IP address!  reliable delivery between adjacent nodes  seldom used on low bit-error link (fiber, some twisted pair)  wireless links: high error rates
  • 6. Link Layer 5-6  flow control:  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 services (more)
  • 7. Link Layer 5-7 Where is the link layer implemented?  in each and every host  link layer implemented in “adaptor” (aka network interface card NIC) or on a chip  Ethernet card, 802.11 card; Ethernet chipset  implements link, physical layer  attaches into host’s system buses  combination of hardware, software, firmware
  • 8. Link Layer 5-8 Link layer, LANs: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing, ARP  Ethernet  switches  VLANS 5.5 link virtualization: MPLS 5.6 data center networking 5.7 a day in the life of a web request
  • 13. 13 Error Detection  Data transmission can contain errors  Single-bit  Burst errors of length n (n: distance between the first and last errors in data block)  How to detect errors  If only data is transmitted, errors cannot be detected  Send more information with data that satisfies a special relationship  Add redundancy
  • 16. 16 Error Detection Methods  Vertical Redundancy Check (VRC)  Append a single bit at the end of data block such that the number of ones is even  Even Parity (odd parity is similar) 0110011  01100110 0110001  01100011  VRC is also known as Parity Check  Performance: • Detects all odd-number errors in a data block
  • 17. Winter 2005 ECE ECE 766 17 Error Detection Methods  Longitudinal Redundancy Check (LRC)  Organize data into a table and create a parity for each column 11100111 11011101 00111001 10101001 11100111 11011101 00111001 10101001 10101010 11100111 11011101 00111001 10101001 10101010 Original Data LRC
  • 18. Winter 2005 ECE ECE 766 18 Error Detection Methods  Performance: • Detects all burst errors up to length n (number of columns) • Misses burst errors of length n+1 if there are n-1 uninverted bits between the first and last bit • If the block is badly garbled, the probability of acceptance is ( )n 2 1
  • 21. Polynomial Figure 9-12 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
  • 22. Figure 9-13 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998 Polynomial and Divisor
  • 23. Standard Polynomials Figure 9-14 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
  • 25. Checksum Figure 9-15 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998 • Used by upper layer protocols • Similar to LRC, uses one’s complement arithmetic
  • 26. Figure 9-16 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998 Data Unit and Checksum
  • 27. Error Correction Figure 9-17 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
  • 29. Figure 9-19 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998 Hamming Code
  • 30. Figure 9-19-continued WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998 Hamming Code
  • 31. Figure 9-20 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998 Example of Hamming Code
  • 32. Single-bit error Figure 9-21 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998
  • 33. Figure 9-22 WCB/McGraw-Hill © The McGraw-Hill Companies, Inc., 1998 Error Detection
  • 34. Link Layer 5-34 Link layer, LANs: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing, ARP  Ethernet  switches  VLANS
  • 35. Link Layer 5-35 Multiple access protocols  It avoids two or more nodes from transmitting at the same time over a broadcast channel.  If different nodes send data at the same time collisions occurs and the receiver will not be able to understand the signal.  Classes of MAP  Partitioning the channel eg. FDM & TDM  Taking turns eg. Token based, polling based & reservation based  Contention based protocol e.g. ALOHA and Ethernet
  • 36. Link Layer 5-36 Multiple access protocols Different multiple access protocols.. Random access protocols-  channel not divided, allow collisions  “recover” from collisions Controlled access protocols-  Nodes take turns, but nodes with more to send can take longer turns. Channelization protocols-  divide channel into smaller “pieces” (time slots, frequency, code)  allocate piece to node for exclusive use
  • 37. Link Layer 5-37 Multiple access protocols  Different multiple access protocols..  Random access protocols  ALOHA  CSMA  CSMA/CD  Controlled access protocols  Reservation  Polling  Token passing  Channelization protocols  FDMA  TDMA
  • 38. Link Layer 5-38 Multiple access links, 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)  old-fashioned Ethernet  upstream HFC  802.11 wireless LAN shared wire (e.g., cabled Ethernet) (e.g., 802.11 WiFi)
  • 39. Link Layer 5-39 An ideal multiple access protocol given: broadcast channel of rate R bps desiderata: 1. when one node wants to transmit, it can send at rate R. 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized: • no special node to coordinate transmissions • no synchronization of clocks, slots 4. simple
  • 40. Link Layer 5-40 Channel partitioning MAC protocols: TDMA TDMA: time division multiple access  access to channel in "rounds"  each station gets fixed length slot (length = pkt trans time) in each round  unused slots go idle  example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle 1 3 4 1 3 4 6-slot frame 6-slot frame
  • 41. Link Layer 5-41 FDMA: frequency division multiple access  channel spectrum divided into frequency bands  each station assigned fixed frequency band  unused transmission time in frequency bands go idle  example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequencybands time FDM cable Channel partitioning MAC protocols: FDMA
  • 42. Link Layer 5-42 Random access protocols  when node has packet to send  transmit at full channel data rate R.  no a priori coordination among nodes  two or more transmitting nodes ➜ “collision”,  random access MAC protocol specifies:  how to detect collisions  how to recover from collisions (e.g., via delayed retransmissions)  examples of random access MAC protocols:  Pure (Unslotted )ALOHA  slotted ALOHA  CSMA, CSMA/CD, CSMA/CA
  • 43. Link Layer 5-43 ALOHA  It signifies a simple communications schemes in which each transmitter within a network sends data whenever there is a frame to send.  Next frame is sent only if the previous frame successfully reaches the destination.  If frame fails to reach at the destination , it is sent again.  Types of ALOHA  Pure ALOHA  Slotted ALOHA
  • 44. Link Layer 5-44 Pure (unslotted) ALOHA  unslotted Aloha: simpler, no synchronization  when frame first arrives  transmit immediately  collision probability increases:  frame sent at t0 collides with other frames sent in [t0-1,t0+1]
  • 45. Link Layer 5-45 Pure (unslotted) ALOHA  unslotted Aloha: simpler, no synchronization  when frame first arrives  transmit immediately  collision probability increases:  frame sent at t0 collides with other frames sent in [t0-1,t0+1]
  • 46. Link Layer 5-46 Pure ALOHA efficiency P(success by given node) = P(node transmits) . P(no other node transmits in [t0-1,t0] . P(no other node transmits in [t0-1,t0] = p . (1-p)N-1 . (1-p)N-1 = p . (1-p)2(N-1) … choosing optimum p and then letting n = 1/(2e) = .18
  • 47. Link Layer 5-47 Slotted ALOHA assumptions:  all frames same size  time divided into equal size slots (time to transmit 1 frame)  nodes start to transmit only slot beginning  nodes are synchronized  if 2 or more nodes transmit in slot, all nodes detect collision operation:  when node obtains fresh frame, transmits in next slot  if no collision: node can send new frame in next slot  if collision: node retransmits frame in each subsequent slot with prob. p until success
  • 48. Link Layer 5-48 Pros:  single active node can continuously transmit at full rate of channel  highly decentralized: only slots in nodes need to be in sync  simple Cons:  collisions, wasting slots  idle slots  nodes may be able to detect collision in less than time to transmit packet  clock synchronization Slotted ALOHA 1 1 1 1 2 3 2 2 3 3 node 1 node 2 node 3 C C CS S SE E E
  • 49. Link Layer 5-49  suppose: N nodes with many frames to send, each transmits in slot with probability p  prob that given node has success in a slot = p(1-p)N- 1  prob that any node has a success = Np(1-p)N-1  max efficiency: find p* that maximizes Np(1-p)N-1  for many nodes, take limit of Np*(1-p*)N-1 as N goes to infinity, gives: max efficiency = 1/e = .37 efficiency: long-run fraction of successful slots (many nodes, all with many frames to send) at best: channel used for useful transmissions 37% of time! ! Slotted ALOHA: efficiency
  • 50. Link Layer 5-50 CSMA (carrier sense multiple access) CSMA: listen before transmit: if channel sensed idle: transmit entire frame  if channel sensed busy, defer transmission  human analogy: don’t interrupt others!
  • 51. Link Layer 5-51 CSMA (carrier sense multiple access) • Non-persistent CSMA • 1-persistent CSMA • P-persistent CSMA
  • 52. Link Layer 5-52 CSMA (carrier sense multiple access) • Non-persistent CSMA • In this , if a station wants to transmit a frame and it finds that the channel is busy then it will wait for fixed interval of time. • After some time ,it again checks the status of the channel • If channel is free it will transmit • 1-persistent CSMA • P-persistent CSMA
  • 53. Link Layer 5-53 CSMA (carrier sense multiple access) • Non-persistent CSMA • 1-persistent CSMA • The station which wants to transmit , continuously monitors the channel until it is idle and then transmits immediately. • If two are waiting then they will transmit simultaneously and collision take place then require retransmission • P-persistent CSMA
  • 54. Link Layer 5-54 CSMA (carrier sense multiple access) • Non-persistent CSMA • 1-persistent CSMA • P-persistent CSMA • All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle • Possibility of collision and retransmission is reduced • A station is assumed to be transmitted with a probability p
  • 55. Link Layer 5-55 CSMA/CD (collision detection)
  • 56. Link Layer 5-56 CSMA/CD (collision detection) CSMA/CD: carrier sensing, deferral as in CSMA  collisions detected within short time  colliding transmissions aborted, reducing channel wastage  collision detection:  easy in wired LANs: measure signal strengths, compare transmitted, received signals  difficult in wireless LANs: received signal strength overwhelmed by local transmission strength  human analogy: the polite conversationalist
  • 57. Link Layer 5-57 CSMA/CD (procedure)
  • 58. Link Layer 5-58 CSMA/CD efficiency  Tprop = max prop delay between 2 nodes in LAN  ttrans = time to transmit max-size frame so ttrans >= 2Tprop iL/R>=2*D/S L>=2DR/S so of less than frame length then collision detection mechanism not possible  efficiency goes to 1  as tprop goes to 0  as ttrans goes to infinity transprop /tt efficiency 51 1 + =
  • 59.  Station ready to transmit, senses the the line by using one of persistent technique.  As soon as it find the line to be idle , the station waits for a time equal to an IFG(Interframe Gap).  It then wait for some random time and sends the frame.  After sending the frame . It sets a timer and waits for the ack from the receiver.  If the ack is received before expiry of the timer , then the transmitter is successful.  But if the transmitting station does not receive the expected ack before the timer expiry then the increments the back off parameter , waits for the back off time and senses the line again. Data Link Layer 5-59 CSMA/CA (Collision Avoidance)
  • 60. Data Link Layer 5-60 CSMA/CA (Collision Avoidance)
  • 61. Link Layer 5-61 Multiple access protocols  Different multiple access protocols..  Random access protocols  ALOHA  CSMA  CSMA/CD  Controlled access protocols  Polling  Token passing  Channelization protocols  FDMA  TDMA
  • 62. Link Layer 5-62 • It requires one of the nodes to be designated as a master node. • The master node polls each of the nodes in a round-robin fashion. • the master node first sends a message to node 1, saying that it (node 1) can transmit up to some maximum number of frames. • After node 1 transmits some frames, the master node tells node 2 it (node 2) can transmit up to the maximum number of frames. Controlled access protocols-Polling
  • 63. Link Layer 5-63 • The master node can determine when a node has finished sending its frames by observing the lack of a signal on the channel.  The procedure continues in this manner, with the master node polling each of the nodes in a cyclic manner.  It eliminates the collisions and allows polling to achieve a much higher efficiency Controlled access protocols-Polling master slaves poll data data
  • 64. Link Layer 5-64 Disadvantage - •Polling delay—the amount of time required to notify a node that it can transmit. •if the master node fails, the entire channel becomes inoperative. Controlled access protocols-Polling
  • 65. 5-65  In this protocol there is no master node.  A small, special-purpose frame known as a token is exchanged among the nodes in some fixed order.  When a node receives a token, it holds onto the token only if it has some frames to transmit otherwise, it immediately forwards the token to the next node. Controlled access protocols-Token Passing T data (nothing to send) T
  • 66. Link Layer 5-66 • If a node does have frames to transmit when it receives the token, it sends up to a maximum number of frames and then forwards the token to the next node. • It is decentralized and highly efficient. Disadvantage-  The failure of one node can crash the entire channel.  if a node accidentally neglects to release the token, then some recovery procedure must be invoked to get the token back in circulation. Controlled access protocols-Token Passing
  • 67. Link Layer 5-67 Link layer, LANs: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing, ARP  Ethernet  switches  VLANS
  • 68. Link Layer 5-68 MAC addresses and ARP  32-bit IP address:  network-layer address for interface  used for layer 3 (network layer) forwarding  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)
  • 69. Link Layer 5-69 LAN addresses and ARP each adapter on LAN has unique LAN address adapter 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN (wired or wireless)
  • 70. Link Layer 5-70 LAN addresses (more)  MAC address allocation administered by IEEE  manufacturer buys portion of MAC address space (to assure uniqueness)  analogy:  MAC address: like Social Security Number  IP address: like postal address  MAC flat address ➜ portability  can move LAN card from one LAN to another  IP hierarchical address not portable  address depends on IP subnet to which node is attached
  • 71. Link Layer 5-71 ARP: address resolution protocol ARP table: each IP node (host, router) on LAN has table  IP/MAC address mappings for some LAN nodes: < IP address; MAC address; TTL>  TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine interface’s MAC address, knowing its IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 137.196.7.23 137.196.7.78 137.196.7.14 137.196.7.88
  • 72. Link Layer 5-72 ARP protocol: same LAN  A wants to send datagram to B  B’s MAC address not in A’s ARP table.  A broadcasts ARP query packet, containing B's IP address  dest MAC address = FF-FF- FF-FF-FF-FF  all nodes 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)  soft state: information that times out (goes away) unless refreshed  ARP is “plug-and-play”:  nodes create their ARP tables without intervention from net administrator
  • 73. Link Layer 5-73 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  assume A knows R’s MAC address Addressing: routing to another LAN R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B
  • 74. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-74 Addressing: routing to another LAN IP Eth Phy IP src: 111.111.111.111 IP dest: 222.222.222.222  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
  • 75. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-75 Addressing: routing to another LAN IP Eth Phy  frame sent from A to R IP Eth Phy  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-4B IP src: 111.111.111.111 IP dest: 222.222.222.222 IP src: 111.111.111.111 IP dest: 222.222.222.222
  • 76. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-76 Addressing: routing to another LAN IP src: 111.111.111.111 IP dest: 222.222.222.222  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 Eth Phy IP Eth Phy
  • 77. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-77 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 IP src: 111.111.111.111 IP dest: 222.222.222.222 MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy
  • 78. R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B Link Layer 5-78 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 IP src: 111.111.111.111 IP dest: 222.222.222.222 MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy
  • 79. Link Layer 5-79 Link layer, LANs: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing, ARP  Ethernet  switches
  • 80. Link Layer 5-80 Ethernet 802.3 • IEEE 802.3 (CSMA/CD - Ethernet) standard – originally 2Mbps • IEEE 802.3u standard for 100Mbps Ethernet • IEEE 802.3z standard for 1,000Mbps Ethernet  Most popular packet-switched LAN technology  Bandwidths: 10Mbps, 100Mbps, 1Gbps  Max bus length: 2500m  500m segments with 4 repeaters  Bus and Star topologies are used to connect host.  For transmission 802.3 LAN , it make use of 1- persistant CSMA/CD protocol.  When collision they wait for random time, to select random time Ethernet use Binary Exponential Backoff Algo
  • 81. Link Layer 5-81 Ethernet CSMA/CD algorithm 1. NIC receives datagram from network layer, creates frame 2. If NIC senses channel idle, starts frame transmission. If NIC senses channel busy, waits until channel idle, then transmits. 3. If NIC transmits entire frame without detecting another transmission, NIC is done with frame ! 4. If NIC detects another transmission while transmitting, aborts and sends jam signal 5. After aborting, NIC enters binary (exponential) backoff:  after mth collision, NIC chooses K at random from {0,1,2, …, 2m -1}. NIC waits K·512 bit times, returns to Step 2  longer backoff interval with more collisions
  • 82. Link Layer 5-82 Ethernet frame structure sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame preamble:  7 bytes with pattern 10101010 followed by one byte with pattern 10101011  used to synchronize receiver, sender clock rates dest. address source address data (payload) CRCpreamble type
  • 83. CS 640 83 Ethernet Frames  Preamble is a sequence of 7 bytes, each set to “10101010”  Used to synchronize receiver before actual data is sent  Addresses  unique, 48-bit unicast address assigned to each adapter • example: 8:0:e4:b1:2 • Each manufacturer gets their own address range  broadcast: all 1s  multicast: first bit is 1  Type field is a demultiplexing key used to determine which higher level protocol the frame should be delivered to  Body can contain up to 1500 bytes of data
  • 84. Link Layer 5-84 Ethernet frame structure (more)  addresses: 6 byte source, destination MAC addresses  if adapter receives frame with matching destination address, or with broadcast address (e.g. ARP packet), it passes data in frame to network layer protocol  otherwise, adapter discards frame  type: indicates higher layer protocol key (mostly IP but others possible)  CRC: cyclic redundancy check at receiver  error detected: frame is dropped dest. address source address data (payload) CRCpreamble type
  • 85. Link Layer 5-85 Ethernet: physical topology  bus:  all nodes in same collision domain (can collide with each other)  star: prevails today  active switch in center  each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other) switch bus: coaxial cable star
  • 86. CS 640 86 Ethernet Technologies: 10Base2  10: 10Mbps; 2: under 185 (~200) meters cable length  Thin coaxial cable in a bus topology
  • 87. CS 640 87 10BaseT and 100BaseT  10/100 Mbps rate  T stands for Twisted Pair  Hub(s) connected by twisted pair facilitate “star topology”  Distance of any node to hub must be < 100M
  • 88. CS 640 88 Physical Layer Configurations for 802.3  Physical layer configurations are specified in three parts  Data rate (10, 100, 1,000)  10, 100, 1,000Mbps  Signaling method (base, broad)  Baseband • Digital signaling  Broadband • Analog signaling  Cabling (2, 5, T, F, S, L)  5 - Thick coax (original Ethernet cabling)  F – Optical fiber  S – Short wave laser over multimode fiber  L – Long wave laser over single mode fiber
  • 89. CS 640 89 Fast and Gigabit Ethernet  Fast Ethernet (100Mbps) has technology very similar to 10Mbps Ethernet  Uses different physical layer encoding (4B5B)  Many NIC’s are 10/100 capable • Can be used at either speed  Gigabit Ethernet (1,000Mbps)  Compatible with lower speeds  Uses standard framing and CSMA/CD algorithm  Distances are severely limited  Typically used for backbones and inter-router connectivity  Becoming cost competitive  How much of this bandwidth is realizable?
  • 90. CS 640 90 Experiences with Ethernet  Ethernets work best under light loads  Utilization over 30% is considered heavy • Network capacity is wasted by collisions  Most networks are limited to about 200 hosts  Specification allows for up to 1024  Most networks are much shorter  5 to 10 microsecond RTT
  • 91. Link Layer 5-91 Link layer, LANs: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing, ARP  Ethernet  switches
  • 92. Switch  Device that channels incoming data from any of multiple input ports to the specific output port. Example-traditional telephone network.  In Internet, a switch determines from the IP address in each packet which output port to use for the next part of its trip to the intended destination.
  • 93. Link Layer 5-93 Ethernet switch  link-layer device: takes an active role  store, forward Ethernet frames  examine incoming frame’s MAC address, selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment, uses CSMA/CD to access segment  transparent  hosts are unaware of presence of switches  plug-and-play, self-learning  switches do not need to be configured
  • 94. Link Layer 5-94 Switch: multiple simultaneous transmissions  hosts have dedicated, direct connection to switch  switches buffer packets  Ethernet protocol used on each incoming link, but no collisions; full duplex  each link is its own collision domain  switching: A-to-A’ and B-to-B’ can transmit simultaneously, without collisions switch with six interfaces (1,2,3,4,5,6) A A’ B B’ C C’ 1 2 345 6
  • 95. Link Layer 5-95 Switch forwarding table Q: how does switch know A’ reachable via interface 4, B’ reachable via interface 5? switch with six interfaces (1,2,3,4,5,6) A A’ B B’ C C’ 1 2 345 6 A: each switch has a switch table, each entry:  (MAC address of host, interface to reach host, time stamp)  looks like a routing table! Q: how are entries created, maintained in switch table?  something like a routing protocol?
  • 96. A A’ B B’ C C’ 1 2 345 6 Link Layer 5-96 Switch: self-learning  switch learns which hosts can be reached through which interfaces  when frame received, switch “learns” location of sender: incoming LAN segment  records sender/location pair in switch table A A’ Source: A Dest: A’ MAC addr interface TTL Switch table (initially empty) A 1 60
  • 97. Link Layer 5-97 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 */
  • 98. A A’ B B’ C C’ 1 2 345 6 Link Layer 5-98 Self-learning, forwarding: example A A’ Source: A Dest: A’ MAC addr interface TTL switch table (initially empty) A 1 60 A A’A A’A A’A A’A A’  frame destination, A’, locaton unknown: flood A’ A  destination A location known: A’ 4 60 selectively send on just one link
  • 99. Link Layer 5-99 Interconnecting switches  switches can be connected together Q: sending from A to G - how does S1 know to forward frame destined to F via S4 and S3? A: self learning! (works exactly the same as in single- switch case!) A B S1 C D E F S2 S4 S3 H I G
  • 100. Link Layer5-100 Self-learning multi-switch example Suppose C sends frame to I, I responds to C  Q: show switch tables and packet forwarding in S1, S2, S3, S4 A B S1 C D E F S2 S4 S3 H I G
  • 101. Link Layer5-101 Institutional network to external network router IP subnet mail server web server
  • 102. Link Layer5-102 Switches vs. routers both are store-and-forward: routers: network-layer devices (examine network- layer headers) switches: link-layer devices (examine link-layer headers) both have forwarding tables: routers: compute tables using routing algorithms, IP addresses switches: learn forwarding table using flooding, learning, MAC addresses application transport network link physical network link physical link physical switch datagram application transport network link physical frame frame frame datagram