Top Banner
Computer Network (CN) Unit 4: Medium Access Control Sublayer Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering 1
153
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CN MAC layer

Rejo Mathew, Asst Prof, IT

Computer Network (CN)Unit 4: Medium Access Control Sublayer

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 2: CN MAC layer

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

MAC Layer Overall

• Deal with broadcast networks and their protocols.

• The key issue is to determine WHO gets to use the channel when there is competition.

• Broadcast channels are sometimes referred to as multi access channels or random access channels.

• The protocols used to determine who gets next on a multi access channel belong to a sub layer of the data link layer called the MAC (Medium Access Control) sub layer.

Rejo Mathew, Asst Prof, IT

Page 3: CN MAC layer

Rejo Mathew, Asst Prof, IT

Topics• Channel Allocation Problem

• Random Access Protocols

• Controlled Access

• Channelization

• Ethernet

• Data Link Layer Switching

• HDLC

• PPP

• Introduction to X.25, Frame Relay and ATMMukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 4: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.1 The Channel Allocation Problem

4.1.1 Static Channel Allocation in LANs and MANs

FDM: Frequency Division MultiplexingTDM: Time Division Multiplexing

Advantage? Disadvantage?

Advantage : Suitable for fixed number of users with constant traffic

Disadvantage: When the number of users is large and continuously varying or the traffic is bursty, FDM presents some problems.

Page 5: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.1 The Channel Allocation Problem

4.1.1 Static Channel Allocation in LANs and MANs

A simple queuing theory calculation

Channel capacity = C bps, Arrival rate = l frames/sec, each frame having a length drawn from an exponential probability density function with mean 1/m bits/frame,

Mean Time delay

C

T1

divide the single channel up into N independent subchannels, each with capacity C/N bps. The mean input rate on each of the subchannel will now be l/N. Recomputing T, we get

NTNNC

TFDM

)/()/(

1

Page 6: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.1 The Channel Allocation Problem

4.1.2 Dynamic Channel Allocation in LANs and MANs

Five key assumptions:

1. Station Model. The model consists of N independent stations, each with a program or user that generates frames for transmission.

The probability of a frame being generated in an interval of length Dt is lDt, where l is a constant (the arrival rate of new frames).

Once a frame has been generated, the station is blocked and does nothing until the frame has been successfully transmitted.

2. Single Channel Assumption. A single channel is available for all communication. All stations can transmit on it and all can receive from it.

As far as the hardware is concerned, all stations are equivalent, although some

protocol software may assign priorities to them.

Page 7: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.1 The Channel Allocation Problem

4.1.2 Dynamic Channel Allocation in LANs and MANs

Five key assumptions:

3. Collision Assumption. If two frames are transmitted simultaneously, they overlap in time and the resulting signal is garbled. This event is called a collision.

All stations can detect collisions. A collided frame must be transmitted again alternately. There are no errors other than those generated by collisions.

Page 8: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.1 The Channel Allocation Problem

4.1.2 Dynamic Channel Allocation in LANs and MANs

Five key assumptions:

4a. Continuous Time. Frame transmission can begin at any instant. There is no master clock dividing time into discrete intervals.

4b. Slotted Time. Time is divided into discrete intervals (slots). Frame transmissions always begin at the start of a slot. A slot may contain 0, 1, or more frames, corresponding to an idle slot, a successful transmission, or a collision, respectively.

5a. Carrier Sense. Stations can tell if the channel is in use before trying to use it. If the channel is sensed as busy, no station will attempt to use it until it goes idle.

5b. No Carrier Sense. Stations cannot sense the channel before trying to use it. They just go ahead and transmit. Only later can they determine whether or not the transmission was successful.

Page 9: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

Pure ALOHA

ALOHA of U. of Hawaii

ComputerCenter

413MHz at 9600bps

407MHz at 9600bps

the first multiple-access protocol: a method for sharing a transmission channel by enabling the transmitter to access thechannel at random times

Page 10: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

Pure ALOHA Frames are transmitted at completely arbitrary times.

Page 11: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

Pure ALOHA protocol

• nodes transmit on a common channel• transmit frame of fixed length• when two transmissions overlap, they garble each other (collision)• the central node acknowledges the correct frames it receives• when a node does not get an acknowledgment within a specific timeout, it

assumes that its frame collided• when a frame collides, the transmitting node schedules a retransmission after a random delay

Page 12: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

new frame

old frame

nodes

S

Gchannel

collision?

No

Yes

S

S: the mean number of new frames generated by the infinite populationG: the mean number of transmission attempts (new and old combined)

0PGS where P0 is the probability that a frame does not suffer a collision

Page 13: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

pure ALOHA and slotted ALOHA

time

Nodes can starting transmitting at any time.

pure ALOHA

time

slotted ALOHAslot

Nodes must start their transmissions at the beginning of a time slot.

Page 14: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

vulnerability period

pure ALOHA

packet packet

slotted ALOHA

Other nodes that are ready at this period will result in collision.

Page 15: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

The probability that k frames are generated during a given frame time is given by the Poisson distribution:

!

)2(]Pr[

2

k

eGk

Gk

So the probability of zero frames in a slot is just e-G.

In an interval two time slots long, the mean number of frames generated is 2G. Therefore, the distribution is:

!]Pr[

k

eGk

Gk

The probability of zero frames is e-2G.

Page 16: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

Using S=GP0, we get

For pure ALOHA: S=Ge-2G

For slotted ALOHA: S=Ge-G

S GedS

dGe Ge

dS

dGG S e

S GedS

dGe Ge

dS

dGG S

e

G G G

G G G

, , ,

, , ,

0 1

2 01

2 2

1

2 2 21

To find the maximum value:

Page 17: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

Page 18: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.1 ALOHA

In slotted ALOHA, the best we can hope for is 37% success, 37% slots empty, and 26% collisions. Operating at higher values of G reduces the number of empties but increases the number of collisions exponentially.

Consider the transmission of a test frame: success: e-G, failure: 1-e-G, success for k attempts:

1)1( kGGk eeP

Expected number of transmissions:

G

k

kGG

kk eekekPE

1

1

1

)1(

As a result of the exponential dependence of E upon G, small increases in the channel load can drastically reduce its performance.

Page 19: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.2 Carrier Sense Multiple Access Protocols

With slotted ALOHA the best channel utilization that can beachieved is 1/e. As stations transmitting at will, without paying attention to what other stations are doing, there are bound to be many collisions.

In local area networks, however, it is possible for stations to detect what other stations are doing, and adapt their behavior accordingly.Protocols in which stations listen for a carrier (i.e. a transmission) and act accordingly are called carrier sense protocols.

Page 20: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.2 Carrier Sense Multiple Access Protocols

1-persistent CSMA: if channel idle -> Transmits with a probability of 1 if channel is busy -> Waits until it becomes idle

Non-persistent CSMA: if the channel is idle -> Transmits, If channel is busy -> Waits a random time and tries again

p-persistent CSMA (slotted): if channel idle -> Transmits with a probability p if channel is busy -> Waits until the next slot 1-p. If another station transmitting-> Waits a random time and tries again.

(p=0.5, p=0.75 )takes any value

Page 21: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.2 Carrier Sense Multiple Access Protocols

Page 22: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.2 Carrier Sense Multiple Access Protocols

CSMA with collision detection (CSMA/CD)

Abort a transmission as soon as they detect a collision. Quickly terminating damaged frames saves time and bandwidth.

After a station detects a collision, it aborts its transmission, waits a random period of time, and then tries again, assuming that no other station has started transmitting in the meantime.

Page 23: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.2 Carrier Sense Multiple Access Protocols

A conceptual model for CSMA/CD

(How long should each slot be?)

Page 24: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.2 Carrier Sense Multiple Access Protocols

maximum collision detection timeA B

t=0

PROP

2PROP

1.A startstransmitting 2.B starts

transmitting3. A reaches B

4.B detects collision,transmits JAM, stops

5.B reaches A

6.A detects collision,transmits JAM, stops

The maximum collision detection time is equal totwice the maximum end-to-end propagation delay.

Page 25: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.2 Carrier Sense Multiple Access Protocols

For this reason we will model the contention interval as a slotted ALOHA system with slot width 2t (t is the end to end delay). On a 1-km long coaxial cable, t5msec.

It is important to realize that collision detection is an analog process. The station’s hardware must listen to the cable while it is transmitting. The signal encoding must allow collisions to be detected (e.g., a collision of two 0-volt signals may well be impossible to detect). For this reason, special encoding is commonly used.

Page 26: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.3 Collision-Free Protocols

Although collisions do not occur with CSMA/CD once a station has unambiguously seized the channel, they can still occur during the contention period. These collisions adversely affect the system performance, especially when the cable is long and the frames are short. As very long, high bandwidth fiber optic networks come into use, the combination of large t and short frames will become an increasingly serious problem.

In the protocols to be described, we make the assumption that there are N stations, each with a unique address from 0 to N-1 “wired” into it.

Page 27: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.3 Collision-Free Protocols

A bit-map protocol

Protocols like this in which the desire to transmit is broadcast before the actual transmission are called reservation protocols.

Page 28: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.3 Collision-Free Protocols

Performance of bit-map protocol

Assuming contention slot: 1 slot, data slot: d slots

Low-numbered stations must wait on the average 1.5N slots and high-numbered stations must wait on the average 0.5N slots before starting to transmit, the mean for all stations is N slots.

Channel efficiency at low load: d/(N+d)

Channel efficiency at high load: Nd/(N+Nd)=d/(d+1)

Page 29: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.3 Collision-Free Protocols

Binary Countdown

A dash indicates silence.Station’s binary

address

Page 30: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.3 Collision-Free Protocols

Binary Countdown

The channel efficiency of this method is d/(d+lnN). If, however, the frame format has been cleverly chosen so that the sender’s address is the first field in the frame, even these lnN bits are not wasted, and the efficiency is 100%.

Variations: Use virtual station numbers. The successful station being circularly permuted after each transmission.

Stations C H D A G B E FPriority 7 6 5 4 3 2 1 0 if D transmitsPriority 7 6 0 5 4 3 2 1 others are promoted

Page 31: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

Two important performance measures for channel acquisition strategies: delay at low load and channel efficiency at high load

Contention protocolContention-free protocol

Light load Heavy load

channel delay efficiency

good bad

bad good

Page 32: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

Obviously, it would be nice if we could combine the best properties of the contention and collision-free protocols, arriving at a new protocol that used contention at low loads to provide low delay, but used a collision-free technique at high load to provide good channel efficiency.

Such protocols will be called limited contention protocols.

Page 33: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

Up until now the only contention protocols we have studied have been symmetric, that is, each station attempts to acquire the channel with some probability p, will all stations using the same p.

Performance of the symmetric case: suppose that k stations are contending for channel access, each has a probability p of transmitting during each slot

The probability that some station successfully acquire the channel is kp(1-p)k-1

Maximum occurs at p=1/k with Pr[success with optimal p]=

11

k

k

k

Page 34: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

As soon as the number of stations reaches even 5, the probability has dropped close to it asymptotic value of 1/e.

Page 35: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

Limited contention protocols decrease the amount of competition by dividing the stations up into (not necessarily disjoint) groups. Only the members of group 0 are permitted to compete for slot 0. If one of then succeeds, it acquires the channel and transmits its frame.

If the slot lies fallow or if there is a collision, the members of group 1 contend for slot 1, etc. by making an appropriate division of stations into groups, the amount of contention for each slot can be reduced, thus operating each slot near the left end of Fig. 4-8.

Page 36: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

The adaptive tree walk protocol

Slot 0

Slot 1 (if collision)

Depth first search for all ready stations

Page 37: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

When the load on the system is heavy, it is hardly worth the effort to dedicate slot 0 to node 1, because that makes sense only in the unlikely event that precisely one station has a frame to send. Similarly, one could argue that nodes 2 and 3 should be skipped as well for the same reason.

Put in more general terms, at what level in the tree should the search begin?

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 38: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

Assume that each station has a good estimate of the number of ready stations, q, for example, from monitoring recent traffic.

Assume the root (node 1) is at level 0. Each node at level i has a fraction 2-i of the stations below it.

If the q ready stations are uniformly distributed, the expected number of them below a specific node at level i is just 2-iq. Intuitively, we would expect the optimal level to begin searching the tree as the one at which the mean number of contending stations per slot is 1, that is, the level at which 2-iq=1. Solving this equation we find that i=log2q.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 39: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.4 Limited-Contention Protocols

Improvements:

For example, consider the case of stations G and H being the only ones waiting to transmit. Probe node 1: collisionProbe node 2: idleProbe node 6: idleProbe GProbe H Node 3 and node 7 can be skipped.

Why?

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 40: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.6 Wireless LAN Protocols

The hidden terminal problem

When A transmits to B and C also transmits to B simultaneously, the frames will be collided at B. Since A and C can not see each other.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 41: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.6 Wireless LAN Protocols

The exposed terminal problem

When C hears B’s transmission intended for A, it may falsely conclude that it can not send to D now.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 42: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.6 Wireless LAN Protocols

MACA (Multiple Access with Collision Avoidance)

MACA: basis for IEEE802.11 wireless LAN standard

The basic idea behind it is for the sender to simulate the receiver into outputting a short frame, so stations nearby can detect this transmission and avoid transmitting themselves fir the during of upcoming (large) data frame.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 43: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.6 Wireless LAN Protocols

MACA (Multiple Access with Collision Avoidance)

RTS (30 bytes) and CTS contains the data length that will eventually follow.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 44: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.6 Wireless LAN Protocols

MACA (Multiple Access with Collision Avoidance)

Any station hearing the RTS is clearly close to A and must remain silent long enough for the CTS to be transmitted back to A without conflict.

Any station hearing the CTS is clearly close to B and must remain silent during the upcoming data transmission, whose length it can tell by examining the CTS frame.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 45: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.6 Wireless LAN Protocols

MACA (Multiple Access with Collision Avoidance)

Despite these precautions, collisions can still occur. For example, B and C could both send RTS frames to A at the same time. In the event of a collision, an unsuccessful transmitter (I.e., one that does not hear a CTS within the expected time interval) waits a random amount of time and tries again later. The algorithm used is binary exponential backoff.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 46: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.2 Multiple Access Protocols

4.2.6 Wireless LAN Protocols

MACAW (MACA for Wireless)

1. Introducing an ACK frame after each successful data transmission2. Adding carrier sense (keeping a station from transmitting an RTS at the same

time another nearby station is also doing so to the same destination3. Running the backoff algorithm separately for each data stream rather than for

each station (improving fairness)4. Exchanging information about congestion between stations and making

backoff algorithm react less violently

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 47: CN MAC layer

Controlled Access

• Reservation

• Polling

• Token passing

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 48: CN MAC layer

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Channelization

• FDMA

• TDMA

• CDMA

Rejo Mathew, Asst Prof, IT

Page 49: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 EthernetIEEE 802.1 Bridging (networking) and Network Management IEEE 802.2 Logical link control IEEE 802.3 Ethernet IEEE 802.4 Token bus IEEE 802.5 Defines the MAC layer for a Token Ring IEEE 802.6 Metropolitan Area Networks IEEE 802.7 Broadband LAN using Coaxial Cable IEEE 802.8 Fiber Optic TAG IEEE 802.9 Integrated Services LAN IEEE 802.10 Interoperable LAN SecurityIEEE 802.11 Wireless LAN & Mesh (Wi-Fi certification) IEEE 802.12 demand priority IEEE 802.13 Cat.6 - 10Gb lan (new founded) IEEE 802.14 Cable modems IEEE 802.15 Wireless PAN IEEE 802.15.1 (Bluetooth certification) IEEE 802.15.4 (ZigBee certification) IEEE 802.16 Broadband Wireless Access (WiMAX certification) IEEE 802.16e (Mobile) Broadband Wireless Access

IEEE 802.17 Resilient packet ring IEEE 802.18 Radio Regulatory TAG IEEE 802.19 Coexistence TAG IEEE 802.20 Mobile Broadband Wireless Access IEEE 802.21 Media Independent Handoff IEEE 802.22 Wireless Regional Area Network

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 50: CN MAC layer

Rejo Mathew, Asst Prof, IT

IEEE 802.3: 1-persistent CSMA/CD

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 51: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 52: CN MAC layer

Rejo Mathew, Asst Prof, IT

To allow larger networks, multiple cables can be connected by repeaters.

A repeater is a physical layer device. It receives, reenergizes and reshapes the signals in both directions. As far as the software is concerned, a series of cable segments connected by repeaters is no different than a single cable.

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 53: CN MAC layer

Rejo Mathew, Asst Prof, IT

Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 54: CN MAC layer

Rejo Mathew, Asst Prof, IT

10BASE5 10BASE2 1BASE5 10BROAD36 10BASE-TEthernet Cheaper net StarLAN Broadband Twisted-pair

medium coaxial cable50ohm-10mm

coaxial cable50ohms-5mm

twisted-pairunshielded

coaxial cable75ohms

2 simplex TPunshielded

signals

maximumsegment

nodes persegment

collisiondetection

Notes

10MbpsManch

10MbpsManch

1MbpsManch

10MbpsDPSK

10MbpsManch

500m 185m 500m 1800m 100m

maximumdistance 2.5km 0.925km 2.5km 3.6km 1km

100 30 2

excess current 2 active hubinputs

transmission=reception

activity onreceiver andtransmitter

slot time=512 bits; gap time=96 bits; jam=32 to 48 bitsMukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 55: CN MAC layer

Rejo Mathew, Asst Prof, IT

Manchester Encoding

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 56: CN MAC layer

Rejo Mathew, Asst Prof, IT

802.3 frame format

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 57: CN MAC layer

Rejo Mathew, Asst Prof, IT

802.3 frame format

Minimum frame length: 64 bytes

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 58: CN MAC layer

Rejo Mathew, Asst Prof, IT

802.3 Frame Format

As the network speed goes up, the minimum frame length must go up or the maximum cable length must come down proportionally.

Distance = 2500m Speed = 1 Gbps, Min.frame size = 6400 bytes.

Alternatively,

Min.frame size = 64 bytes Max distance = 250 meters.

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 59: CN MAC layer

Rejo Mathew, Asst Prof, IT

Ethernet Frame Structure v2 (or DIX Ethernet, for DEC, Intel, Xerox)

Preamble SFD DA SA type CRC

synchronizethe receiver

7 1 6 6 2 4

60 to 1514 bytes

Start FrameDelimiter

Cyclic Redundancy Check

Type>0x0600=1536

Data

0800: IPv4 datagram0806: ARP request/reply8035: RARP request/reply86DD: IPv6

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 60: CN MAC layer

Improving Aloha

• Aloha

– Low goodput

• What is missing in Aloha?

– Carrier sensing not done; a node transmits whenever it wants to

• How can it be improved?

– Sense the carrier before transmission

• Will this improve Aloha?Mukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 61: CN MAC layer

Carrier Sense Multiple Access (CSMA)

• When medium sensed two possibilities

– Medium busy or free

a) If medium free transmit immediately

b) If medium busy wait (how long?)

i. Goto (a)

• This is non-persistent CSMA; what are the variables?

• Improving CSMA: the variables here are

– wait time – when to sense again

– instant when to transmitMukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 62: CN MAC layer

Carrier Sense Multiple Access (CSMA)

• Wait time and transmit instant – each can be

– Random or 0, (changing according to some algorithm)

• Wait time

– 0 = persistent

– Random = non-persistent

• Transmit instant

– Transmit with probability ‘p’

• Node can transmit now, since medium is free

• It tosses a coin and then decides (p=0.5)

• If wait time=0; and p=1 then called p-persistent CSMAMukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 63: CN MAC layer

Changing Transmit TimeMore nodes

• Two node is trivial; add more nodes

• A] Wait for some time; then check the medium again

– Since some node may have started already

– What is the flaw with this approach? We have separated the nodes

• Fairness: Some nodes may be stuck in [A] forever

– Some algorithm needed to tackle this problem

– How to achieve fairness?

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 64: CN MAC layer

Medium Access Control Logic

Page 65: CN MAC layer

IEEE 802.11 Exponential Backoff

• Node selects a random wait time t; from a contention window time interval

• To ensure fairness

– Nodes which have waited longer should have preference

– Need to determine nodes which have waited longer

• Backoff algo should handle this

– Sense medium during backoff interval; if medium busy then freeze backoff timer

– When medium free again, unfreeze backoff timer

• Is this good enough?Mukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 66: CN MAC layer

IEEE 802.11 Exponential Backoff

• Two nodes -> some more nodes -> Add large number of nodes

– Is the backoff algo good enough?

• Primarily we are trying to do TDMA

• Since large number of nodes; need to be spaced out further in time

– With base station infrastructure, the BS does it

– Here the nodes have to do it themselves

– Effectively make the frame bigger and transmit in a later slot

• 802.11 Binary Exponential backoff

– If collision after backoff timer; double the backoff time windowMukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 67: CN MAC layer

Rejo Mathew, Asst Prof, IT

The Binary Exponential Backoff Algorithm

If a frame has collided n successive times, where n<16, then thenode chooses a random number K with equal probability from theset {0,1,2,3,...,2m-1} where m=min{10,n}. The node then waits for bit times. (slot time=512 bit time)

K512

after first collision

after second collision

after thirdcollision

select one to start transmission

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 68: CN MAC layer

Rejo Mathew, Asst Prof, IT

Acknowledgements

As far as CSMA/CD is concerned, an acknowledgement would be just another frame and would have to fight for channel time just like a data frame.

(What is the problem?)

A simple modification would allow speedy confirmation of frame receipt. All that would be needed is to reserve the first contention slot following successful transmission for the destination station.

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 69: CN MAC layer

Rejo Mathew, Asst Prof, IT

Performance

Assume k stations are always ready to transmit and a constant retransmission probability in each slot. (A rigorous analysis of the binary exponential backoff algorithm is complicated.)

If each station transmits during a contention slot with probability p, the probability A that some station acquires the channel in that slot is

. as 1

with,1

whenmaximized is

)1( 1

k/eAk

pA

pkpA k

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 70: CN MAC layer

Rejo Mathew, Asst Prof, IT

Performance

The probability that the contention interval has exactly j slots in it is A(1-A)j-1, so the mean number of slots per contention is given by

AAjA

j

j 1)1(

0

1

Since each slot has a duration 2t, the mean contention interval, w, is 2t/A. Assuming optimal p, the mean number of contention slots is never more than e, so w is at most 2te5.4t.

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 71: CN MAC layer

Rejo Mathew, Asst Prof, IT

Performance

If the mean frame takes P sec to transmit, when many stations have frames to send, channel efficiency=

AP

P

/2Here we see where the maximum cable distance between any two stations enters into the performance figures. The longer the cable, the longer the contention interval. By allowing no more than 2.5km of cable and four repeaters between any two transceivers, the round-trip time can be bounded to 51.2 msec, which at 10Mbps corresponds to 512 bits or 64 bytes, the minimum frame size.

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 72: CN MAC layer

Rejo Mathew, Asst Prof, IT

Performance

Let P=F/B (frame_length/bandwidth) and t=L/C (cable_length/signal_propagation_speed). For the optimal case of e contention slots per frame, channel efficiency=

cFBLe /21

1

Increasing network bandwidth or distance (the BL product) reduces efficiency for a given frame size. Unfortunately, much research on network hardware is aimed precisely at increasing this product. People want high bandwidth over long distances, which suggests that 802.3 may not be the best system for these applications.

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 73: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 74: CN MAC layer

Rejo Mathew, Asst Prof, IT

Many theoretical analysis assume the input traffic is Poisson. It now appears that network traffic is rarely Poisson, but self-similar. What this means is that averaging over long periods of time does not smooth out the traffic.

The average number of packets in each minute of an hour has as much variance as the average number of packets in each second of s minute.

The consequence of this discovery is that most models of network traffic do not apply to the real world and should be taken with a grain of salt.

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 75: CN MAC layer

Rejo Mathew, Asst Prof, IT

Switched 802.3 LANs

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 76: CN MAC layer

Rejo Mathew, Asst Prof, IT

The three primary reasons that the 803 committee decided togo with a souped-up 802.3 LAN (instead of a totally new one) were:1. The need to be backward compatible with thousands of existing LANs.2. The fear that a new protocol might have unforeseen problems.3. The desire to get the job done before the technology changed.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 77: CN MAC layer

Rejo Mathew, Asst Prof, IT

The basic idea behind fast Ethernet was simple: keep all the old packet formats, interfaces, and procedural rules, but just reduce the bit time form 100 nsec to 10 nsec.

Technically, it would have been possible to copy 10Base5 or 10Base2 and still detect collisions on time by just reducing the maximum cable length by a factor of ten.

However, the advantages of 10BaseT wiring were so overwhelming that fast Ethernet is based entirely on this design. Thus all fast Ethernet systems use hubs.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 78: CN MAC layer

Rejo Mathew, Asst Prof, IT

The category 3 UTP scheme, called 100Base-T4, uses a signaling speed of 25 MHz, only 25 percent faster than standard 802.3’s 20 MHz. To achieve the necessary bandwidth, 100BaseT4 requires four twisted pairs.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 79: CN MAC layer

Rejo Mathew, Asst Prof, IT

Of the four twisted pairs, one is always to the hub, one is always from the hub, and the other two are switchable to the current transmission direction.

To get the necessary bandwidth, Manchester encoding is not used, but with modern clocks and such short distances, it is no longer needed.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 80: CN MAC layer

Rejo Mathew, Asst Prof, IT

Ternary signals are sent, so that during a single clock period the wire can contain a 0, a 1, or a 2. With three twisted pairs going in the forward direction and ternary signaling, any one of the 27 possible symbols can be transmitted, making it possible to send 4 bits with some redundancy. Transmitting 4 bits in each of the 25 million clock cycles per second gives the necessary 100 Mbps.

In addition, there is always a 33.3 Mbps (100/3) reverse channel using the remaining twisted pair. This scheme, known as 8B6T, (8 bits map to 6 trits) is not likely to win any prizes for elegance, but it works with the existing wiring plant.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 81: CN MAC layer

Rejo Mathew, Asst Prof, IT

For category 5 wiring, the design, 100Base-TX, is simpler because the wires can handle clock rates up to 125 MHz and beyond. Only two twisted pairs per station are used, one to the hub and one from it.

Rather than just use straight binary coding, a scheme called 4B5B is used at 125 MHz. Every group of 5 clock periods is used to send 4 bits in order to give some redundancy, provide enough transitions to allow easy clock synchronization, create unique patterns for frame delimiting, and be compatible with FDDI in the physical layer.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 82: CN MAC layer

Rejo Mathew, Asst Prof, IT

Consequently, 100Base-TX is a full-duplex system; stations can transmit at 100 Mbps and receive at 100 Mbps at the same time. Often 100Base-TX and 100Base-T4 are collectively referred as 100Base-T.

The last option, 100Base-FX, uses two strands of multimode fiber, one for each direction, so it, too, is full duplex with 100 Mbps in each direction. In addition, the distance between a station and the hub can be up to 2 km.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 83: CN MAC layer

Rejo Mathew, Asst Prof, IT

Two kinds of hubs are possible with 100Base-T4 and 100Base-TX:hub: all incoming lines are logically connected, forming a single collision domain.switches: each incoming frame is buffered on a plug-in line card. Buffered frames are passed over a high-speed backplane from the source card to the destination card.

4.3 Ethernet

Fast Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 84: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

The ink was barely dry on the fast Ethernet standard when the 802 committee bagan working on a yet faster Ethernet. It was quickly dubbed gigabit Ethernet and was ratified by IEEE in 1998 under the name 802.3z.

An important design goal: remain backward compatibility

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 85: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

All configurations of gigabit Ethernet are point-to-point.

Each individual Ethernet cable has exactly two devices on it, no more and no fewer.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 86: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

Two different modes of operation: full duplex and half duplex

Normal mode -- full-duplex - connected to a switch.

No need to sense the channel because contention is impossible. So CSMA/CD protocol is not used.

So the maximum length of the cable is determined by signal strength issues rather than by the collision detection issue.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 87: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

Half-duplex -- connected to a hub.

A hub does not buffer incoming frames. So collisions are possible and CSMA/CD is required.

Transmission time for a 64-byte frame - 100 times faster. So the distance is 100 times < Ethernet i.e. 25 meters.

The 802.3z committee considered a radius of 25 meters to be unacceptable and added two features to the standard to increase the radius.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 88: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

1.Carrier extension, essentially tells the hardware to add its own padding to extend the frame to 512 bytes. Of course, using 512 bytes to transmit 64 bytes of data has a line efficiency of 9%.

2.Frame bursting, allows a sender to transmit a concatenated sequence of multiple frames in a single transmission. If the total length is less than 512 bytes, the hardware pads it again.

Just for backward compatibility. Most will use switches.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 89: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

Cabling

Gigabit Ethernet uses new encoding rules on the fiber. Manchester encoding at 1Gbps would require 2G baud signal, too difficult and too wasteful.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 90: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

8B/10B is used. Each 8-bit byte is encoded as 10 bits.256 out of 1024. Two rules are used:1. No codeword may have more than four identical bits in a row.2. No codeword may have more than six 0s or six 1s.

In addition, many input bytes have two possible codewords assigned to them. When there is a choice, the encoder always chooses the one that tries to equalize the number of 0s and 1s transmitted so far.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 91: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

1000Base-T uses a different encoding scheme since clocking data onto copper wire in 1 nsec is too difficult.

The solution uses four category 5 twisted pairs to allow four symbols to be transmitted in parallel.

Each symbol is encoded using one of five voltage levels. This scheme allows a single symbol to encode 00, 01, 10, 11, or a special value for control purposes.

The clock runs at 125MHz, allowing 1-Gbps operation.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 92: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Gigabit Ethernet

Gigabit Ethernet supports flow control which consists of one end sending a special control frame to the other end telling it to pause for some period of time.

For gigabit Ethernet, the time unit for pause is 512 nsec. The maximum is 33.6 msec.

802.3ae: 10G Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 93: CN MAC layer

Rejo Mathew, Asst Prof, IT

IEEE Standard 802.2: Logical Link Control

4.3 Ethernet

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 94: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.3 Ethernet

Why Ethernet is so successful? Last more than 20 years!

Ethernet is simple and flexible.

Simple translates into reliable, cheap, and easy to maintain.

Ethernet interworks easily with TCP/IP. Both IP and Ethernet are connectionless.

Speed can catch up with other standards.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 95: CN MAC layer

Rejo Mathew, Asst Prof, IT

A

Bridge

CLANs can be connected by devices called bridges, which operate in the data link layer. Bridges do not examine the network layer header.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 96: CN MAC layer

Rejo Mathew, Asst Prof, IT

A

Router

C

Router

In contrast, a router examines network layer headers.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 97: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Multiple LANs connected by a backbone to handle a total load higher than the capacity of a single LAN.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 98: CN MAC layer

Rejo Mathew, Asst Prof, IT

Why a single organization may end up with multiple LANs? (to need bridges)

1. Autonomy of departments to choose their own types of LANs2. Cheaper to have separate LANs than to run a single large LANs3. Load splitting4. Physical distance is too great. (For example, >2.5km in 802.3)5. More reliable6. More secure

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 99: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Operation of a LAN bridge from 802.11 to 802.3.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 100: CN MAC layer

Rejo Mathew, Asst Prof, IT

Bridges from 802.x to 802.y

You might naively think that a bridge from 802 LAN to another one would be completely trivial. Such is not the case. Each of the nine combinations of 802.x to 802.y has its own unique set of problems.

General problems:1. Different frame format2. Different data rate3. Different maximum frame length

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 101: CN MAC layer

Rejo Mathew, Asst Prof, IT

Bridges from 802.x to 802.y

4.7 Datalink Layer Switching

The IEEE 802 frame formats. The drawing is not to scale.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 102: CN MAC layer

Rejo Mathew, Asst Prof, IT

Transparent Bridges

When a frame arrives, a bridge must decide whether to discard or forward it, and if the latter, on which LAN to put the frame. The decision is made by looking up the destination address in a big (hash) table inside the bridge.

Plug and play bridge

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 103: CN MAC layer

Rejo Mathew, Asst Prof, IT

Transparent Bridges

When the bridges are first plugged in, all the hash tables are empty. None of the bridges know where any of the destinations are, so they use the Flooding algorithm.Use backward learning algorithm. If a frame comes from LAN1 with source address A, the bridge learns that host A is in LAN1.The topology can change as machines and bridges are powered up and down and moved around. To handle dynamic topologies, whenever a hash table entry is updated, the time is recorded. Periodically, a process in the bridge scans the hash table and purges all entries more than a few minutes old.

4.7 Datalink Layer Switching

Routing procedure for a transparent bridge:1. If the destination and source LANs are the same, discard the frame.2. If the destination and source LANs are different, forward the frame.3. If the destination LAN is unknown, use flooding.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 104: CN MAC layer

Rejo Mathew, Asst Prof, IT

Transparent Bridges

Avoid looping in parallel bridges.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 105: CN MAC layer

Rejo Mathew, Asst Prof, IT

Transparent Bridges

Spanning Tree Bridges

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 106: CN MAC layer

Rejo Mathew, Asst Prof, IT

Transparent Bridges

Spanning Tree Bridges

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 107: CN MAC layer

Rejo Mathew, Asst Prof, IT

Transparent Bridges

Spanning Tree Bridges

To build the spanning tree, first the bridges have to choose one bridge to be the root of the tree. They make this choice by having each one broadcast its serial number, installed by the manufacturer, and guaranteed to be unique worldwide. The bridge with the lowest serial number becomes the root. Next, a tree of shortest paths from the root to every bridge and LAN is constructed.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 108: CN MAC layer

Rejo Mathew, Asst Prof, IT

Source Routing BridgesSource routing assumes that the sender of each frame knows whether or not the destination is on its own LAN. When sending a frame to a different LAN, the source machine sets the high-order bit of the source address to 1, to mark it. Furthermore, it includes in the frame header the exact path that the frame will follow.

4.7 Datalink Layer Switching

This path is constructed as follows. Each LAN has a unique 12-bit number, and each bridge has a 4-bit number that uniquely identifies it in the context of its LANs. A route is then a sequence of bridge, LAN, bridge, LAN, … numbers.

For example, the route from A to D: (L1, B1, L2, B2, L3)Mukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 109: CN MAC layer

Rejo Mathew, Asst Prof, IT

Source Routing Bridges

A source routing bridge is only interested in those frames with the high-order bit of the destination set to 1.

For each such frame, it scans the route looking for the number of the LAN on which the frame arrived.

If this LAN number is followed by its own bridge number, the bridge forwards the frame onto the LAN whose number follows its bridge number in the route.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 110: CN MAC layer

Rejo Mathew, Asst Prof, IT

Source Routing Bridges

Three possible implementations:1. Software: the bridge runs in promiscuous mode, copying all frames to its memory to see if they have the high-order destination bit set to 1. If so, the frame is inspected further.

2. Hybrid: the bridge’s LAN interface inspects the high-order destination bit and only accepts frame with the bit set. This interface is easy to build into hardware and greatly reduces the number of frames the bridge must inspect.

3. Hardware: the bridge’s LAN interface not only checks the high-order destination bit, but it also scans the route to see if this bridge must do forwarding. Only frames that must actually be forwarded are given to the bridge. This implementation requires the most complex hardware but wastes no bridge CPU cycles because all irrelevant frames are screened out.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 111: CN MAC layer

Rejo Mathew, Asst Prof, IT

Source Routing Bridges

Implicit in the design of source routing bridge is that every machine in the internetwork knows, or can find, the best path to every other machine. How these routes are discovered is an important part of the source routing bridge.

The basic idea is that if a destination is unknown, the source issues a broadcast frame asking where it is. This discovery frame is forwarded by every bridge so that it reaches every LAN on the internetwork. When the reply comes back, the bridges record their identity in it, so that the original sender can see the exact route taken and ultimately choose the best route.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 112: CN MAC layer

Rejo Mathew, Asst Prof, IT

Source Routing Bridges

While this algorithm clearly finds the best route (it finds all routes), it suffers from a frame explosion.

3N-1 frames here.

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 113: CN MAC layer

Rejo Mathew, Asst Prof, IT

Comparison of 802 Bridges

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 114: CN MAC layer

Rejo Mathew, Asst Prof, IT

Remote Bridges

Point to point protocol used between bridges:1. Choose some standard point-to-point protocol, putting complete MAC frames in the payload field (best if all LANs are identical)2. Strip off the MAC header at source bridge, put back at destination(can not catch errors caused by bad bridge memory)

4.7 Datalink Layer Switching

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 115: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Repeaters, Hubs, Bridges, Switches, Routers, and Gateways

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 116: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Repeaters, Hubs, Bridges, Switches, Routers, and Gateways

Hub Bridge Switch

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 117: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Virtual LANs

A building with centralized wiring using hubs and a switch.Mukesh Patel School of Technology Management and Engineering

www.nmims.edu/Engineering

Page 118: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Virtual LANs

(a) Four physical LANs organized into two VLANs, gray and white, by two bridges. (b) The same 15 machines organized into two VLANs by switches.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 119: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not.

Virtual LANs: 802.1Q Standard

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 120: CN MAC layer

Rejo Mathew, Asst Prof, IT

4.7 Datalink Layer Switching

Virtual LANs: 802.1Q Standard

The 802.3 (legacy) and 802.1Q Ethernet frame formats.

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 121: CN MAC layer

Rejo Mathew, Asst Prof, IT

Summary

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Page 122: CN MAC layer

High-Level Data Link Control (HDLC)

• HDLC was defined by ISO for use on both point-to-point and multipoint data links.

• It supports full-duplex communication

• Other similar protocols are

– Synchronous Data Link Control (SDLC) by IBM

– Advanced Data Communication Control Procedure (ADCCP) by ANSI

– Link Access Procedure, Balanced (LAP-B) by CCITT, as part of its X.25 packet-switched network standard

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof, IT

Page 123: CN MAC layer

HDLC Overview

Broadly HDLC features are as follows:• Reliable protocol

– selective repeat or go-back-N

• Full-duplex communication– receive and transmit at the same time

• Bit-oriented protocol– use bits to stuff flags occurring in data

• Flow control– adjust window size based on receiver capability

• Uses physical layer clocking and synchronization to send and receive frames

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 124: CN MAC layer

HDLC Overview• Defines three types of stations

– Primary

– Secondary

– Combined

• Defines three types of data transfer mode

– Normal Response mode

– Asynchronous Response mode

– Asynchronous Balanced mode

• Three types of frames

– Unnumbered

– Information

– SupervisoryMukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 125: CN MAC layer

HDLC

• The three stations are :– Primary station

• Has the responsibility of controlling the operation of data flow the link.

• Handles error recovery

• Frames issued by the primary station are called commands.

– Secondary station, • Operates under the control of the primary station.

• Frames issued by a secondary station are called responses.

• The primary station maintains a separate logical link with each secondary station.

– Combined station, • Acts as both as primary and secondary station.

• Does not rely on other for sending data

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 126: CN MAC layer

HDLC

Primary

Secondary Secondary

Commands

Responses

Combined Combined

commands/Responses

Unbalanced Mode

Balanced mode

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 127: CN MAC layer

HDLC

• The three modes of data transfer operations are– Normal Response Mode (NRM)

• Mainly used in terminal-mainframe networks. In this case,

• Secondaries (terminals) can only transmit when specifically instructed by the primary station in response to a polling

• Unbalanced configuration, good for multi-point links

– Asynchronous Response Mode (ARM)

• Same as NRM except that the secondaries can initiate transmissions without direct polling from the primary station

• Reduces overhead as no frames need to be sent to allow secondary nodes to transmit

• Transmission proceeds when channel is detected idle , used mostly in point-to-point-links

– Asynchronous Balanced Mode (ABM)

• Mainly used in point-to-point links, for communication between combined stations

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 128: CN MAC layer

Data Link Control HDLC frame structure

(a) Frame Format

(b) Control field format

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 129: CN MAC layer

Data Link ControlHDLC frame structure

(c) Extended address field (d) Extended control field

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof, IT

Page 130: CN MAC layer

HDLC• Flag: 01111110- start and ending delimiter. Bits are stuffed for flags in data frames

• FCS: 16-bit CRC using generating polynomial

G(x) = x16 + x12 + x5 + 1

• Address field:

– mainly used in multidrop link configuration, and not used in point-to-point

– In unbalanced configuration, every secondary is assigned a unique address. Contains address of secondary station in both command and response frames

– In balanced mode, command frame has destination address and response frame has sending node’s address

– Group addresses are also possible. E.g., One command sent to all the secondaries

• In I-frames, N(s) is the sequence number of the frame being sent, and R(s) is the sequence number of the frame being expected.

• The P/F bit, known as the poll/final bit, is used with different meaning in different contexts.

– It is used to indicate polling, to indicate the final I-frame, etc

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 131: CN MAC layer

HDLC

• There are three different classes of frames used in HDLC

– Unnumbered frames, used in link setup and disconnection, and hence do not contain ACK.

– Information frames, which carry actual information. Such frames can piggyback ACK in case of ABM

– Supervisory frames, which are used for error and flow control purposes and hence contain send and receive sequence numbers

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 132: CN MAC layer

HDLC

• There are four different supervisory frames

– SS=00, Receiver Ready (RR), and N(R) ACKs all frames received up to and including the one with sequence number N(R) - 1

– SS=10, Receiver Not Ready (RNR), and N(R) has the same meaning as above

– SS=01, Reject; all frames with sequence number N(R) or higher are rejected, which in turns ACKs frames with sequence number N(R) -1 or lower.

– SS=11, Selective Reject; the receive rejects the frame with sequence number N(R)

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 133: CN MAC layer

HDLC

• The unnumbered frames can be grouped into the following categories:

– Mode-setting commands and responses

– Recovery commends and responses

– Miscellaneous commands and responses

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 134: CN MAC layer

PPP Design Requirements [RFC 1557]Functionality : (similar to link layer services + extra

management functions)

• Packet framing - encapsulation of network-layer datagram in data link frame

– Multi-protocol - carry network layer data of any network layer protocol (not just IP) at same time ability to demultiplex upwards

• Bit transparency - must carry any bit pattern in the data field (even if underlying channel can't)

• Error detection - not correction

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 135: CN MAC layer

PPP Design Requirements (cont.)

The extra stuff:

• Connection liveness: detect, signal link failure to network layer

• Network layer address negotiation: endpoint can learn/configure each other’s network address and other characteristics.

• Authentication: who are you (or at least whose account do I bill for your dial-in time?)

– This information is used by traffic management software to control bandwidth to individual subscribers

• Management features: loopback detection

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 136: CN MAC layer

PPP non-requirements

• No error correction/recovery

(modems do one layer FEC, one layer packetization + retransmission “under the covers” anyway; other technologies are pretty reliable)

• No flow control

• Out of order delivery OK

Error recovery, flow control, data re-ordering

all relegated to higher layers!

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 137: CN MAC layer

PPP Data Frame

• Flag: delimiter (framing)

• Address: ignored. (historical)

• Control: ignored. (historical)

• Protocol: upper layer protocol to which frame delivered (e.g., PPP-LCP, IP, IPCP, etc)

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 138: CN MAC layer

PPP Data Frame

• info: upper layer data being carried

• check: cyclic redundancy check for error detection

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 139: CN MAC layer

Byte Stuffing

flag bytepatternin datato send

flag byte pattern plusstuffed byte in transmitted data

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 140: CN MAC layer

PPP Data Control Protocol

Before exchanging network-layer data, data link peers must

• Configure PPP link (max. frame length, authentication)

• Learn/configure network

layer information

– for IP: carry IP Control Protocol (IPCP) msgs (protocol field: 8021) to configure/learn IP address

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 141: CN MAC layer

Where does PPP get used?

• Dial-up – PPP over async serial, over modem

• ADSL – PPP over Ethernet

• Backbone – Packet over SONET (POS)

• Why?

– Framing (dialup, POS)

– Efficiency (POS)

– Authentication, address negotiation (PPPoE)

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering Rejo Mathew, Asst Prof, IT

Page 142: CN MAC layer

Introduction to ATM,X.25 and Frame Relay

ATM has four important differences from frame relay:–ATM uses fixed packet lengths of 53 bytes (5 bytes of overhead and 48 bytes of user data), which is more suitable for voice transmissions.

–ATM provides extensive quality of service information that enables the setting of very precise priorities among different types of transmissions (i.e. voice, video & email; services include CBR, VBR, ABR and UBR).

–ATM is scalable. It is easy to multiplex basic ATM circuits into much faster ATM circuits.

–ATM provides connection-oriented services only.

Page 143: CN MAC layer

An ATM cell

Page 144: CN MAC layer

ATM layers in endpoint devices and switches

Page 145: CN MAC layer

X.25•In case of packet switching networks, the attached stations

must organize their data into packets for transmission.•This requires a certain level of cooperation between the

network and the attached stations.•X.25 is an ITV-T standard that specifies on interface between a

host system and packet switching network.•The functionality of X.25 is specified in three levels they are: Ø Physical level ØLink Level ØPacket level

Page 146: CN MAC layer

X.25Physical level:•Physical level deals with the physical interface between an attached station

and the link that attaches that station to the packet switching node.Link level:• The link level provides for the reliable transfer of data across the physical

link, by transmitting the data as a sequence of frames.• The link level standard is referred to as LAPB (link access protocol

balanced)LAPB is subset of HDLC. Packet level:•The packet level provides a virtual circuit service.• This service enables any subscriber to the network to setup logical

connections called virtual circuits, to other subscribers.

Page 147: CN MAC layer

X.25

Page 148: CN MAC layer

Format of a Frame in X.25

Page 149: CN MAC layer

Frame Relay

• Frame relay is designed to provide more efficient transmission than X.25.

• The traditional approach of packet switching makes use of X.25.

1.Multiplexing of virtual circuits takes place at layers 2.Both layer 2 and 3 include flow control and

Page 150: CN MAC layer

Frame relay Network

Page 151: CN MAC layer

Frame relay frame

Page 152: CN MAC layer

Comparing Layers in Frame Relay and X.25

Page 153: CN MAC layer

Mukesh Patel School of Technology Management and Engineering www.nmims.edu/Engineering

Rejo Mathew, Asst Prof, IT