data link layer - mississippi state universityweb.cse.msstate.edu/~ramkumar/dll2.pdf · services...

42
Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Data Link Layer Mahalingam Ramkumar Mississippi State University, MS October 14, 2015 Ramkumar PL

Upload: truongliem

Post on 23-Feb-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Data Link Layer

Mahalingam RamkumarMississippi State University, MS

October 14, 2015

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Outline

1 Services Provides By DL LayerData Link Layer Issues

2 Framing

3 DLL ProtocolsPPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

4 Other Layer 2 Components

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Data Link Layer Issues

Data Link Layer

Provide services to network layer

Types of services

Unacknowledged connectionless serviceAcknowledged connectionless serviceAcknowledged connection-oriented service

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Data Link Layer Issues

Packet vs Frame

TrailerHeader Payload field

Frame

Sending machine

PacketPacket

Receiving machine

TrailerHeader Payload field

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Data Link Layer Issues

Virtual / Actual Communication Path

4

3

2

1

4

3

2

1

4

3

2

1

4

3

2

1

Host 1 Host 2 Host 1 Host 2

Virtual data path

Actual data path

(a) (b)

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Data Link Layer Issues

Issues

Send a sequence of bits from one end of a wire to the otherend.

Synchronization: logical organization of frames

Integrity of the data received (remember noise?)

Type of service provided to higher layers

unreliable — connectionless, no acksreliable — acks, connection oriented (multiple frames sent in aconnection)reliable and efficient delivery (ARQ protocols)

For shared links two other issues: addressing and collisions

Addressed by Medium Access Control protocols

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Framing

Organization of frames

Methods

Character countByte stuffingBit stuffing

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Character Count

Errors may result in loss of synchronization

(b)

(a) 5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3

5 1 2 3 4 7 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3

Character count One character

Error

Frame 1 5 characters

Frame 1

Frame 2 5 characters

Frame 2 (Wrong)

Frame 3 8 characters

Frame 4 8 characters

Now a character count

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Byte Stuffing

Used in PPP. Only for byte oriented communications

A BESC FLAG

A BESC ESC

A ESC BESC ESC FLAG

A ESC BESC ESC ESC

BA FLAG

BA ESC

FLAGA ESC B

ESCA ESC B

FLAGTrailerFLAG Header Payload field

Original characters After stuffing

(a)

(b)

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Bit Stuffing

Simple algorithm - 01111110 used as flagAt transmitter - after 5 consecutive ones insert a zeroAt receiver - In a pattern of 111110 anywhere in the data, removethe trailing zero!

0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0

0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0

Stuffed bits

(a)

(b)

(c) 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0

Why do we need to stuff a 0 in 0111110?

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Bit Stuffing

Why do we need to stuff a 0 in 0111110? (with 5 ones and a zero)Even though flag has six consecutive ones? (01111110)If we don’t, notice the ambiguity

011111010 → 011111010 (unchanged)

01111110 → 011111010 (0 stuffed to separate 5th and 6thone)

If we do the ambiguity is resolved

011111010 → 0111110010

01111110 → 011111010

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

DL Layer Tasks

Receive packets from NL

Add headerAdd CRCFrame the packet (bit/byte stuffing + flags at either end)Hand over DL frame to MAC layer (if the medium is shared),or Physical layer

Receive packets from PL/MAC layer

Unframe (remove stuffed bits/bytes and flags) the packetCheck CRCRemove header and footerHandover payload to higher layer

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

PPP in Dial-up Internet

PC

Routing process

Router

Modems

Internet provider's office

User's home

Client process using TCP/IP

Modem

Dial-up telephone line

TCP/IP connection using PPP

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Point-to-Point Protocol

RFC 1662, 1663

Features

FramingLink Control Protocol (LCP)Network Control Protocol (NCP)

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Overview of PPP

Byte oriented protocol

Byte stuffing for framing

Physical layer is a telephone connection between two modems(client’s modem makes a call to the modem of the ISP)

Telephone connection established. PPP frames are sentinstead of voice signals over the telephone line.

Initially LCP packets sent in PPP frames for negotiation ofphysical layer parameters.

Following this NCP packets are carried by PPP frames toestablish network layer parameters (IP address)

Now the host has access to the Internet. IP packets can besent inside PPP frames.

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

PPP Frame Format

Flag byte 01111110

Address (not needed for point to point connection) always setto 11111111

Control field: default value indicates no ACKs.

During LCP parties can negotiate and decide to drop addressand control bytes

Protocol: specifies LCP, NCP and network protocols like IP,IPX, AppleTalk etc.

Payload (LCP, NCP, IP packets)

Checksum: 2 or 4 bytes (negotiated during LCP)

Flag 01111110

Flag 01111110

Address 11111111

ProtocolControl 00000011

Payload Checksum

Bytes 1 1 1 or 21 Variable 2 or 4 1

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

LCP in PPP

The bits sent as pulses correspond to fax data or PPP frames

Telephone connections can have great variation in quality

Initially a base-line quality is assumed to send PPP framescarrying LCP packets.

LCP is negotiation to agree on achievable bits per chunk andthe appropriate constellation to use.

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

NCP in PPP

After LCP an improved PPP link can be used to carrypayloads

Before IP packet can be sent NCP is needed

NCP involves client authentication, issuing an IP address tothe client, and conveying other useful parameters likenet-mask and IP of a local DNS server.

Only after NCP does the client become a “citizen of theInternet” capable of sending and receiving IP packets to anyInternet host

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

ADSL Equipment

DSLAM

Splitter

Codec

Splitter

Telephone

To ISP

ADSL modem

Ethernet

Computer

Telephone line

Telephone company end office Customer premises

Voice switch

NID

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Cable Internet

Usually the cable is a ring around the neighborhood (shared)connected to a head-end

Over 750 MHz bandwidth - most used for TV channels

0 108

TV TV Downstream data

Downstream frequencies

Ups

tream

da

taU

pstre

am

frequ

enci

es

FM

550 750 MHz

5 42 54 88

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Upstream and Downstream

Contention in upstream

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

ADSL vs Cable

Bandwidth: shared (cable) vs dedicated (DSL)

Upstream: shared in cable with contention;Downstream: shared in cable with no contention

Peak performance (better for cable when there are very fewusers)

Security

QOS (Quality of Service)

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Manchester Encoding

Bit stream 1 0 0 0 0 1 0 1 1 1 1

Binary encoding

Manchester encoding

Differential Manchester encoding

Transition here indicates a 0

Lack of transition here indicates a 1

(a)

(b)

(c)

Unambiguousdetection of start of each bit.Each bit period divided into two intervals. Twice the bandwidthEvery bit period has a transition in the middle

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

DIX (DEC, Intel, Xerox) and 802.3

Preamble(a)

Bytes

Type Data PadCheck-

sumDestination

addressSource address

8 2 0-1500 0-46 46 6

Preamble(b) Length Data PadCheck-

sumDestination

addressSource address

1.Preamble - 8 octets (each 10101010)2. Addresses - 6 bytes each. Dest. all ones address - broadcast3. Destination address all ones implies broadcast; bit 46 used todistinguish local and global addresses;4. Type — of payload5. Data — upto 1500 bytes. Minimum limit ?6. Pad — To cater for minimum packet length7. Checksum8. IEEE 802.3: SoF Delimiter (for compatibility), Type to Length

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Minimum Packet Size

For 10 Mbps LAN, maximum distance of 2500 m between twostations

In practice, upto 4 repeaters may be used

Propagation delay 25µs — 10 + 15µs overall repeater delay.

τd = 50µs.

Smallest allowed packet size is 500 bits (Ethernet prescribes64 bytes (512 bits) as the minimum packet size).

For 100 Mbps LAN Ethernet standard recommends maxlength 250 m

1µs + 1.5µs repeater delay. τd = 5µs.

Minimum packet size is again 500 bits (64 bytes)

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Binary Exponential Back-off in Ethernet

For any station time is slotted with slot duration 2τ (a slotbegins at the instant a collision is sensed)

After first collision, retransmit at the next slot with probabilityhalf.

If collision happens again retransmit at next slot withprobability 1/4

If a third collision occurs retransmit with probability 1/8, andso on

After r collisions, transmission probability is 12r

Binary exponential back-off. After r = 10 probability does notfall below 1

210= 1/1024

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Ethernet Families

Based on speed

10Base5 (thick coax), 10Base2 (thin coax), 10Base-T(Twisted Pair), 10Base-F (Fiber optics)

Fast ethernet (802.3u), 100Base-T4 (category 3 UTP),100Base-TX (category 5), 100Base-FX (Fiber)

No changes in protocol - just better wires (and bettertechnology for ethernet cards)

Backward compatibility

Maximum length reduced (otherwise we need to increaseminimum frame size!) Why?

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Gigabit ethernet (802.3z)

Once again backward compatible

Need to reduce length further - unacceptable

Carrier extension - Padding to extend frame to 512 bytes.Frame bursting - concatenated sequence of frames.

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

MACAW - MACA for Wireless

Some enhancements to MACA

MAC layer acknowledgements. To receive ACK there shouldbe no collision at the transmitter of the original packet. Soexposed station problem is deliberately not addressed.

CSMA for transmitting RTS

Back-off algorithm for each source-destination pair instead offor each station.

Additional information exchange about congestion.

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Virtual Channel Sensing

RTS DataA

CTS ACKB

C

D

NAV

NAV

Time

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

802.11 Modes

DCF - Distributed Coordination Function

Each node determine what to do next

PCF - Point Coordination Function

Base station broadcasts beacon frames (10-100 times per sec)Could provide QOS guaranteesCoordinator can even request nodes to go to “sleep”

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

PCF - DCF Coordination

SIFS - Short IFS, PIFS - PCF IFS, DIFS - DCF IFS, EIFS -Extended IFS

ACK

Time

SIFS

PIFS

DIFS

Control frame or next fragment may be sent here

EIFS

PCF frames may be sent here

DCF frames may be sent hereBad frame recovery done here

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

802.11 Frame Structure

Frame control

Bytes

Dur- ation

Address 1

Address 2

Address 3

Address 4

Seq. Data

2 2 6 6 6 62 0-2312

Check- sum

4

Version Type Subtype

2Bits 2 4

To DS

From DS

MF Re- try

Pwr More W O Frame control

1 1 1 1 1 1 11

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Frame Control

11 subfields!

Version, Data type (data, control, management), subtype(RTS, CTS)

To DS, From DS - for interoperability with 802.3

MF - more fragments

Retry - retransmission (ABP 0)

Power management (sleep)

More - additional frames to be sent

W - WEP in use

O - strict processing

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

Other Fields

Duration (includes duration of ACK) - for managing NAV

Address 3 and 4 - to handle handover for inter-cell traffic

Sequence - frame number

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

PPPADSL and Cable InternetEthernet - IEEE 802.3Wireless Ethernet IEEE 802.11

802.11 Protocol Stack

802.11 Infrared

802.11 FHSS

802.11 DSSS

802.11a OFDM

802.11b HR-DSSS

MAC sublayer

Physical layer

Data link layer

Upper layers

Logical link control

802.11g OFDM

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

A Typical LAN

Cluster on a single LAN

B B B BBackbone LAN

Bridge

Work- station

File server

LAN

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Bridges

Bridges interconnect LANs (interconnect collision domains tocreate a broadcast domain)

Need for bridges

LANs might have sprouted independentlySometimes (geographically well distributed) cheaper to connectdifferent segments with a bridge than run a single cableControlling load in each LANVery large physical distances (greater than 2500 m)ReliabilitySecurity

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Local Internetworking

Should the frame be forwarded? To whom?Hash tables

D EB1 B2A B C

F G H

LAN 1 LAN 2 LAN 3

LAN 4Bridge

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Backward Learning

Hash tables are empty at first

If route to destination not known flood over all lines

If destination and source are on the same line discard packet

If destination and source are on different lines, forward

Backward learning — operate in promiscuous mode

Inspect source address of each packet seen to get someknowledge of the topology

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Repeaters, Hubs, Bridges, Switches, Routers, Gateways

Application layer Application gateway

Transport layer Transport gateway

Network layer Router Frame header

Packet header

TCP header

Packet (supplied by network layer)

Frame (built by data link layer)

(b)(a)

User data

CRC

Data link layer Bridge, switch

Physical layer Repeater, hub

Ramkumar PL

Services Provides By DL LayerFraming

DLL ProtocolsOther Layer 2 Components

Hubs, Bridges, Switches

A B C D

E F G H

(a) (b)

Hub Bridge Switch

Host

LAN

(c)

A B C D

E F G H

A B C D

E F G H

Ramkumar PL