chapter 5 my_ppt

102
UNIT -5 The Link layer and Local Area Networks

Upload: prachi-thakor

Post on 05-Aug-2015

20 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Chapter 5 my_ppt

UNIT -5 The Link layer and Local Area Networks

Link Layer 5-2

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-3

Link layer introductionterminology 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 eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg 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 ldquoMACrdquo addresses used in frame headers to

identify source dest bull 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

bull 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 ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card 80211

card Ethernet chipset implements link

physical layer attaches into hostrsquos

system buses combination of

hardware software firmware

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 2: Chapter 5 my_ppt

Link Layer 5-2

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-3

Link layer introductionterminology 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 eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg 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 ldquoMACrdquo addresses used in frame headers to

identify source dest bull 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

bull 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 ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card 80211

card Ethernet chipset implements link

physical layer attaches into hostrsquos

system buses combination of

hardware software firmware

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 3: Chapter 5 my_ppt

Link Layer 5-3

Link layer introductionterminology 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 eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg 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 ldquoMACrdquo addresses used in frame headers to

identify source dest bull 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

bull 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 ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card 80211

card Ethernet chipset implements link

physical layer attaches into hostrsquos

system buses combination of

hardware software firmware

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 4: Chapter 5 my_ppt

Link Layer 5-4

Link layer context

datagram transferred by different link protocols over different links eg Ethernet on

first link frame relay on intermediate links 80211 on last link

each link protocol provides different services eg 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 ldquoMACrdquo addresses used in frame headers to

identify source dest bull 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

bull 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 ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card 80211

card Ethernet chipset implements link

physical layer attaches into hostrsquos

system buses combination of

hardware software firmware

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 5: Chapter 5 my_ppt

Link Layer 5-5

Link layer services framing link access

encapsulate datagram into frame adding header trailer

channel access if shared medium ldquoMACrdquo addresses used in frame headers to

identify source dest bull 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

bull 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 ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card 80211

card Ethernet chipset implements link

physical layer attaches into hostrsquos

system buses combination of

hardware software firmware

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 6: Chapter 5 my_ppt

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

bull 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 ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card 80211

card Ethernet chipset implements link

physical layer attaches into hostrsquos

system buses combination of

hardware software firmware

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 7: Chapter 5 my_ppt

Link Layer 5-7

Where is the link layer implemented in each and every host link layer implemented

in ldquoadaptorrdquo (aka network interface card NIC) or on a chip Ethernet card 80211

card Ethernet chipset implements link

physical layer attaches into hostrsquos

system buses combination of

hardware software firmware

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 8: Chapter 5 my_ppt

Link Layer 5-8

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches VLANS

55 link virtualization MPLS

56 data center networking

57 a day in the life of a web request

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 9: Chapter 5 my_ppt

Figure 9-1

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 10: Chapter 5 my_ppt

Single-bit error

Figure 9-2

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 11: Chapter 5 my_ppt

Multiple-bit errorFigure 9-3

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 12: Chapter 5 my_ppt

Burst errorFigure 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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 13: Chapter 5 my_ppt

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

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 14: Chapter 5 my_ppt

RedundancyFigure 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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 15: Chapter 5 my_ppt

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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 16: Chapter 5 my_ppt

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 011001100110001 01100011

VRC is also known as Parity Check Performance

bull Detects all odd-number errors in a data block

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 17: Chapter 5 my_ppt

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

17

Error Detection Methods

Longitudinal Redundancy Check (LRC) Organize data into a table and create a

parity for each column11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010

11100111 11011101 00111001 10101001 10101010

Original Data LRC

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 18: Chapter 5 my_ppt

Winter 2005

ECE

ECE 766Computer Interfacing and Protocols

18

Error Detection Methods

Performancebull Detects all burst errors up to length n

(number of columns)bull Misses burst errors of length n+1 if there are n-1

uninverted bits between the first and last bitbull If the block is badly garbled the probability of

acceptance is n21

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 19: Chapter 5 my_ppt

CRCFigure 9-10

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 20: Chapter 5 my_ppt

Binary Division

Figure 9-11

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 21: Chapter 5 my_ppt

Polynomial

Figure 9-12

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 22: Chapter 5 my_ppt

Figure 9-13

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Polynomial and Divisor

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 23: Chapter 5 my_ppt

Standard PolynomialsFigure 9-14

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 24: Chapter 5 my_ppt

Example-CRC

Data Link Layer 5-24

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 25: Chapter 5 my_ppt

ChecksumFigure 9-15

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

bull Used by upper layer protocolsbull Similar to LRC uses onersquos complement arithmetic

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 26: Chapter 5 my_ppt

Figure 9-16

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Data Unit and Checksum

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 27: Chapter 5 my_ppt

Error CorrectionFigure 9-17

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 28: Chapter 5 my_ppt

Hamming CodeFigure 9-18

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 29: Chapter 5 my_ppt

Figure 9-19

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 30: Chapter 5 my_ppt

Figure 9-19-continued

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Hamming Code

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 31: Chapter 5 my_ppt

Figure 9-20

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Example of Hamming Code

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 32: Chapter 5 my_ppt

Single-bit error

Figure 9-21

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 33: Chapter 5 my_ppt

Figure 9-22

WCBMcGraw-Hill The McGraw-Hill Companies Inc 1998

Error Detection

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 34: Chapter 5 my_ppt

Link Layer 5-34

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 35: Chapter 5 my_ppt

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 amp TDM Taking turns eg Token based polling based amp

reservation based Contention based protocol eg ALOHA and

Ethernet

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 36: Chapter 5 my_ppt

Link Layer 5-36

Multiple access protocols Different multiple access protocolsRandom access protocols-

channel not divided allow collisions ldquorecoverrdquo from collisions

Controlled access protocols- Nodes take turns but nodes with more to

send can take longer turnsChannelization protocols-

divide channel into smaller ldquopiecesrdquo (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 CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 37: Chapter 5 my_ppt

Link Layer 5-37

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Reservation Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 38: Chapter 5 my_ppt

Link Layer 5-38

Multiple access linkstwo types of ldquolinksrdquo 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 80211 wireless LAN

shared wire (eg cabled Ethernet) (eg 80211 WiFi)

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 39: Chapter 5 my_ppt

Link Layer 5-39

An ideal multiple access protocolgiven broadcast channel of rate R bpsdesiderata

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 RM

3 fully decentralizedbull no special node to coordinate transmissionsbull 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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 40: Chapter 5 my_ppt

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 134 have pkt

slots 256 idle

1 3 4 1 3 4

6-slotframe

6-slotframe

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 41: Chapter 5 my_ppt

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 134 have pkt

frequency bands 256 idle

freq

uenc

y ba

nds

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 42: Chapter 5 my_ppt

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 ldquocollisionrdquo

random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via

delayed retransmissions) examples of random access MAC

protocols Pure (Unslotted )ALOHA slotted ALOHA CSMA CSMACD CSMACA

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 43: Chapter 5 my_ppt

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 44: Chapter 5 my_ppt

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-1t0+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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 45: Chapter 5 my_ppt

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-1t0+1]

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 46: Chapter 5 my_ppt

Link Layer 5-46

Pure ALOHA efficiencyP(success by given node) = P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= p (1-p)N-1 (1-p)N-1

= p (1-p)2(N-1)

hellip 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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 47: Chapter 5 my_ppt

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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 48: Chapter 5 my_ppt

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 ALOHA1 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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 49: Chapter 5 my_ppt

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 = 1e = 37

efficiency long-run fraction of successful slots (many nodes all with many frames to send)

at best channelused for useful transmissions 37of time

Slotted ALOHA efficiency

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 50: Chapter 5 my_ppt

Link Layer 5-50

CSMA (carrier sense multiple access)

CSMA listen before transmitif channel sensed idle transmit entire

frame if channel sensed busy defer

transmission

human analogy donrsquot interrupt others

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 51: Chapter 5 my_ppt

Link Layer 5-51

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 52: Chapter 5 my_ppt

Link Layer 5-52

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 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

bull After some time it again checks the status of the channel

bull If channel is free it will transmitbull 1-persistent CSMAbull P-persistent CSMA

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 53: Chapter 5 my_ppt

Link Layer 5-53

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMA

bull The station which wants to transmit continuously monitors the channel until it is idle and then transmits immediately

bull If two are waiting then they will transmit simultaneously and collision take place then require retransmission

bull P-persistent CSMA

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 54: Chapter 5 my_ppt

Link Layer 5-54

CSMA (carrier sense multiple access)

bull Non-persistent CSMAbull 1-persistent CSMAbull P-persistent CSMA

bull All the waiting stations are not allowed to transmit simultaneously as soon as the channel become idle

bull Possibility of collision and retransmission is reduced

bull A station is assumed to be transmitted with a probability p

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 55: Chapter 5 my_ppt

Link Layer 5-55

CSMACD (collision detection)

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 56: Chapter 5 my_ppt

Link Layer 5-56

CSMACD (collision detection)CSMACD 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

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 57: Chapter 5 my_ppt

Link Layer 5-57

CSMACD (procedure)

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 58: Chapter 5 my_ppt

Link Layer 5-58

CSMACD efficiency Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame

so ttrans gt= 2Tprop

iLRgt=2DSLgt=2DRS 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

better performance than ALOHA

transprop ttefficiency

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 59: Chapter 5 my_ppt

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

CSMACA (Collision Avoidance)

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 60: Chapter 5 my_ppt

Data Link Layer 5-60

CSMACA (Collision Avoidance)

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 61: Chapter 5 my_ppt

Link Layer 5-61

Multiple access protocols Different multiple access protocols Random access protocols

ALOHA CSMA CSMACD

Controlled access protocols Polling Token passing

Channelization protocols FDMA TDMA

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 62: Chapter 5 my_ppt

Link Layer 5-62

bull It requires one of the nodes to be designated as a master node

bull The master node polls each of the nodes in a round-robin fashion

bull the master node first sends a message to node 1 saying that it (node 1) can transmit up to some maximum number of frames

bull 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

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 63: Chapter 5 my_ppt

Link Layer 5-63

bull 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 - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 64: Chapter 5 my_ppt

Link Layer 5-64

Disadvantage - bullPolling delaymdashthe amount of time required to notify a node that it can transmit bullif 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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 65: Chapter 5 my_ppt

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

(nothingto send)

T

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 66: Chapter 5 my_ppt

Link Layer 5-66

bull 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

bull It is decentralized and highly efficientDisadvantage- 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 67: Chapter 5 my_ppt

Link Layer 5-67

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 68: Chapter 5 my_ppt

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 lsquolocallyrdquo 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

eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 69: Chapter 5 my_ppt

Link Layer 5-69

LAN addresses and ARPeach 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 orwireless)

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 70: Chapter 5 my_ppt

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

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 71: Chapter 5 my_ppt

Link Layer 5-71

ARP address resolution protocol

ARP table each IP node (host router) on LAN has table

IPMAC address mappings for some LAN nodes

lt IP address MAC address TTLgt

TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

Question how to determineinterfacersquos 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

137196723

137196778

137196714

137196788

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 72: Chapter 5 my_ppt

Link Layer 5-72

ARP protocol same LAN A wants to send

datagram to B Brsquos MAC address not in

A rsquos ARP table A broadcasts ARP query

packet containing Bs 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 (Bs) MAC address frame sent to Arsquos 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 ldquoplug-and-playrdquo 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 ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 73: Chapter 5 my_ppt

Link Layer 5-73

walkthrough send datagram from A to B via R focus on addressing ndash at IP (datagram) and MAC layer (frame) assume A knows Brsquos IP address assume A knows IP address of first hop router R assume A knows Rrsquos MAC address

Addressing routing to another LAN

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 74: Chapter 5 my_ppt

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-74

Addressing routing to another LAN

IPEthPhy

IP src 111111111111 IP dest 222222222222

A creates IP datagram with IP source A destination B A creates link-layer frame with Rs 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-9B222222222220

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 75: Chapter 5 my_ppt

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-75

Addressing routing to another LAN

IPEthPhy

frame sent from A to R

IPEthPhy

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 111111111111 IP dest 222222222222

IP src 111111111111 IP dest 222222222222

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 76: Chapter 5 my_ppt

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-B2-2F-54-1A-0F

B

Link Layer 5-76

Addressing routing to another LAN

IP src 111111111111 IP dest 222222222222

R forwards datagram with IP source A destination B R creates link-layer frame with Bs 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

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 77: Chapter 5 my_ppt

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

IPEthPhy

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 78: Chapter 5 my_ppt

R

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

111111111110E6-E9-00-17-BB-4BCC-49-DE-D0-AB-7D

111111111112

11111111111174-29-9C-E8-FF-55

A

22222222222249-BD-D2-C7-56-2A

22222222222188-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 Bs MAC address as dest

frame contains A-to-B IP datagram

IP src 111111111111 IP dest 222222222222

MAC src 1A-23-F9-CD-06-9B MAC dest 49-BD-D2-C7-56-2A

IPEthPhy

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 79: Chapter 5 my_ppt

Link Layer 5-79

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 LANs addressing ARP Ethernet switches

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 80: Chapter 5 my_ppt

Link Layer 5-80

Ethernet 8023bull IEEE 8023 (CSMACD - Ethernet) standard ndash

originally 2Mbpsbull IEEE 8023u standard for 100Mbps Ethernetbull IEEE 8023z standard for 1000Mbps 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 8023 LAN it make use of 1-

persistant CSMACD protocol When collision they wait for random time to

select random time Ethernet use Binary Exponential Backoff Algo

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 81: Chapter 5 my_ppt

Link Layer 5-81

Ethernet CSMACD algorithm1 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 012 hellip 2m-1 NIC waits K512 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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 82: Chapter 5 my_ppt

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

destaddress

sourceaddress

data (payload) CRCpreamble

type

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 83: Chapter 5 my_ppt

CS 640 83

Ethernet Frames

Preamble is a sequence of 7 bytes each set to ldquo10101010rdquo Used to synchronize receiver before actual data is sent

Addresses unique 48-bit unicast address assigned to each adapter

bull example 80e4b12bull 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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 84: Chapter 5 my_ppt

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 (eg 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

destaddress

sourceaddress

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 85: Chapter 5 my_ppt

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 ldquospokerdquo runs a (separate) Ethernet protocol

(nodes do not collide with each other)

switch

bus coaxial cablestar

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 86: Chapter 5 my_ppt

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 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 87: Chapter 5 my_ppt

CS 640 87

10BaseT and 100BaseT 10100 Mbps rate T stands for Twisted Pair Hub(s) connected by twisted pair facilitate ldquostar

topologyrdquo Distance of any node to hub must be lt 100M

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 88: Chapter 5 my_ppt

CS 640 88

Physical Layer Configurations for 8023

Physical layer configurations are specified in three parts Data rate (10 100 1000)

10 100 1000Mbps Signaling method (base broad)

Basebandbull Digital signaling

Broadbandbull Analog signaling

Cabling (2 5 T F S L) 5 - Thick coax (original Ethernet cabling) F ndash Optical fiber S ndash Short wave laser over multimode fiber L ndash 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 NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 89: Chapter 5 my_ppt

CS 640 89

Fast and Gigabit Ethernet

Fast Ethernet (100Mbps) has technology very similar to 10Mbps Ethernet Uses different physical layer encoding (4B5B) Many NICrsquos are 10100 capable

bull Can be used at either speed Gigabit Ethernet (1000Mbps)

Compatible with lower speeds Uses standard framing and CSMACD 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

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 90: Chapter 5 my_ppt

CS 640 90

Experiences with Ethernet

Ethernets work best under light loads Utilization over 30 is considered heavy

bull 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

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 91: Chapter 5 my_ppt

Link Layer 5-91

Link layer LANs outline

51 introduction services

52 error detection correction

53 multiple access protocols

54 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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 92: Chapter 5 my_ppt

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 framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 93: Chapter 5 my_ppt

Link Layer 5-93

Ethernet switch link-layer device takes an active role

store forward Ethernet frames examine incoming framersquos MAC address

selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment uses CSMACD 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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 94: Chapter 5 my_ppt

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-Arsquo and B-

to-Brsquo can transmit simultaneously without collisions

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 95: Chapter 5 my_ppt

Link Layer 5-95

Switch forwarding table

Q how does switch know A rsquo reachable via interface 4 Brsquo reachable via interface 5

switch with six interfaces(123456)

A

Arsquo

B

Brsquo C

Crsquo

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 tableQ how are entries created maintained in switch table

something like a routing protocol

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 96: Chapter 5 my_ppt

A

Arsquo

B

Brsquo C

Crsquo

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 ldquolearnsrdquo location of sender incoming LAN segment

records senderlocation pair in switch table

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

Switch table (initially empty)

A 1 60

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 97: Chapter 5 my_ppt

Link Layer 5-97

Switch frame filteringforwardingwhen frame received at switch

1 record incoming link MAC address of sending host2 index switch table using MAC destination address3 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

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 98: Chapter 5 my_ppt

A

Arsquo

B

Brsquo C

Crsquo

1 2

345

6

Link Layer 5-98

Self-learning forwarding example

A Arsquo

Source ADest Arsquo

MAC addr interface TTL

switch table (initially empty)

A 1 60

A ArsquoA ArsquoA ArsquoA ArsquoA Arsquo

frame destination Arsquo locaton unknownflood

Arsquo A

destination A location known

Arsquo 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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 99: Chapter 5 my_ppt

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 S3A self learning (works exactly the same as in single-switch case)

A

B

S1

C D

E

FS2

S4

S3

H

I

G

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 100: Chapter 5 my_ppt

Link Layer5-100

Self-learning multi-switch exampleSuppose 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

FS2

S4

S3

H

I

G

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 101: Chapter 5 my_ppt

Link Layer5-101

Institutional network

to externalnetwork

router

IP subnet

mail server

web server

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers
Page 102: Chapter 5 my_ppt

Link Layer5-102

Switches vs routersboth are store-and-forward routers network-layer devices (examine network-layer headers)switches link-layer devices (examine link-layer headers)

both have forwarding tablesrouters compute tables using routing algorithms IP addressesswitches learn forwarding table using flooding learning MAC addresses

applicationtransportnetwork

linkphysical

networklink

physical

linkphysical

switch

datagram

applicationtransportnetwork

linkphysical

frame

frame

frame

datagram

  • UNIT -5 The Link layer and Local Area Networks
  • Link layer LANs outline
  • Link layer introduction
  • Link layer context
  • Link layer services
  • Link layer services (more)
  • Where is the link layer implemented
  • Slide 8
  • PowerPoint Presentation
  • Slide 10
  • Slide 11
  • Slide 12
  • Error Detection
  • Slide 14
  • Slide 15
  • Error Detection Methods
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Example-CRC
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Multiple access protocols
  • Slide 36
  • Slide 37
  • Multiple access links
  • An ideal multiple access protocol
  • Channel partitioning MAC protocols TDMA
  • Channel partitioning MAC protocols FDMA
  • Random access protocols
  • ALOHA
  • Pure (unslotted) ALOHA
  • Slide 45
  • Pure ALOHA efficiency
  • Slotted ALOHA
  • Slide 48
  • Slotted ALOHA efficiency
  • CSMA (carrier sense multiple access)
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • CSMACD (collision detection)
  • Slide 56
  • CSMACD (procedure)
  • CSMACD efficiency
  • CSMACA (Collision Avoidance)
  • Slide 60
  • Slide 61
  • Controlled access protocols-Polling
  • Slide 63
  • Controlled access protocols-Polling
  • Controlled access protocols-Token Passing
  • Slide 66
  • Slide 67
  • MAC addresses and ARP
  • LAN addresses and ARP
  • LAN addresses (more)
  • ARP address resolution protocol
  • ARP protocol same LAN
  • Addressing routing to another LAN
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Ethernet 8023
  • Ethernet CSMACD algorithm
  • Ethernet frame structure
  • Ethernet Frames
  • Ethernet frame structure (more)
  • Ethernet physical topology
  • Ethernet Technologies 10Base2
  • 10BaseT and 100BaseT
  • Physical Layer Configurations for 8023
  • Fast and Gigabit Ethernet
  • Experiences with Ethernet
  • Slide 91
  • Switch
  • Ethernet switch
  • Switch multiple simultaneous transmissions
  • Switch forwarding table
  • Switch self-learning
  • Switch frame filteringforwarding
  • Self-learning forwarding example
  • Interconnecting switches
  • Self-learning multi-switch example
  • Institutional network
  • Switches vs routers