Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components

Data

Mahalingam Ramkumar Mississippi State University, MS

October 14, 2015

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Outline

1 Services Provides By DL Layer Data Link Layer Issues

2 Framing

3 DLL Protocols PPP ADSL and Cable Internet - IEEE 802.3 Wireless Ethernet IEEE 802.11

4 Other Layer 2 Components

Ramkumar PL Services Provides By DL Layer Framing Data Link Layer Issues DLL Protocols Other Layer 2 Components Data Link Layer

Provide services to Types of services Unacknowledged connectionless service Acknowledged connectionless service Acknowledged connection-oriented service

Ramkumar PL Services Provides By DL Layer Framing Data Link Layer Issues DLL Protocols Other Layer 2 Components Packet vs

Sending machine Receiving machine

Packet Packet

Frame

Header Payload field Trailer Header Payload field Trailer

Ramkumar PL Services Provides By DL Layer Framing Data Link Layer Issues DLL Protocols Other Layer 2 Components Virtual / Actual Communication Path

Host 1 Host 2 Host 1 Host 2

4 4 4 4

3 3 3 3 Virtual data path 2 2 2 2

1 1 1 1 Actual data path

(a) (b)

Ramkumar PL Services Provides By DL Layer Framing Data Link Layer Issues DLL Protocols Other Layer 2 Components Issues

Send a sequence of bits from one end of a wire to the other end. Synchronization: logical organization of frames Integrity of the data received (remember noise?) Type of service provided to higher layers unreliable — connectionless, no acks reliable — acks, connection oriented (multiple frames sent in a connection) reliable and efficient delivery (ARQ protocols) For shared links two other issues: addressing and collisions Addressed by protocols

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Framing

Organization of frames Methods Character count Byte stuffing Bit stuffing

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Character Count

Errors may result in loss of synchronization Character count One character

(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

Frame 1 Frame 2 Frame 3 Frame 4 5 characters 5 characters 8 characters 8 characters

Error

(b) 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

Frame 1 Frame 2 Now a (Wrong) character count

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Byte Stuffing

Used in PPP. Only for byte oriented communications

FLAG Header Payload field Trailer FLAG

(a) Original characters After stuffing

A FLAG B A ESC FLAG B

A ESC B A ESC ESC B

A ESC FLAG B A ESC ESC ESC FLAG B

A ESC ESC B A ESC ESC ESC ESC B

(b)

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Bit Stuffing

Simple algorithm - 01111110 used as flag At transmitter - after 5 consecutive ones insert a zero At receiver - In a pattern of 111110 anywhere in the data, remove the trailing zero! (a) 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0

(b) 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

(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 Layer Framing DLL Protocols Other 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 6th one) If we do the ambiguity is resolved 011111010 → 0111110010 01111110 → 011111010

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components DL Layer Tasks

Receive packets from NL Add header Add CRC Frame the packet (bit/byte stuffing + flags at either end) Hand over DL frame to MAC layer (if the medium is shared), or Receive packets from PL/MAC layer Unframe (remove stuffed bits/bytes and flags) the packet Check CRC Remove header and footer Handover payload to higher layer

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 PPP in Dial-up Internet

User's home Internet provider's office Modems PC Client process using TCP/IP Dial-up telephone line

Modem TCP/IP connection using PPP

Router Routing process

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 Point-to-Point Protocol

RFC 1662, 1663 Features Framing Link Control Protocol (LCP) Network Control Protocol (NCP)

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless 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 sent instead of voice signals over the telephone line. Initially LCP packets sent in PPP frames for negotiation of physical layer parameters. Following this NCP packets are carried by PPP frames to establish network layer parameters (IP address) Now the host has access to the Internet. IP packets can be sent inside PPP frames.

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 PPP Frame Format

Flag byte 01111110 Address (not needed for point to point connection) always set to 11111111 Control field: default value indicates no ACKs. During LCP parties can negotiate and decide to drop address and 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)

Bytes 1 1 1 1 or 2 Variable 2 or 4 1

Flag Address Control Flag Protocol Payload Checksum 01111110 11111111 00000011 01111110

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless 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 frames carrying LCP packets. LCP is negotiation to agree on achievable bits per chunk and the appropriate constellation to use.

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 NCP in PPP

After LCP an improved PPP link can be used to carry payloads Before IP packet can be sent NCP is needed NCP involves client authentication, issuing an IP address to the client, and conveying other useful parameters like net-mask and IP of a local DNS server. Only after NCP does the client become a “citizen of the Internet” capable of sending and receiving IP packets to any Internet host

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 ADSL Equipment

Voice switch Telephone

Codec

Splitter Telephone Splitter line NID

Computer DSLAM

ADSL Ethernet modem To ISP Telephone company end office Customer premises

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless 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

5 42 54 88 0 108 550 750 MHz

TV FM TV Downstream data data Upstream

Downstream frequencies Upstream frequencies

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 Upstream and Downstream

Contention in upstream

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless 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 few users) Security QOS ()

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 Manchester Encoding

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

(a) Binary encoding

(b) Manchester encoding

(c) Differential Manchester encoding

Transition here Lack of transition here indicates a 0 indicates a 1 Unambiguous detection of start of each bit. Each bit period divided into two intervals. Twice the bandwidth Every bit period has a transition in the middle

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 DIX (DEC, Intel, Xerox) and 802.3

Bytes 8 6 6 2 0-1500 0-46 4

Destination Source Check- (a) Preamble Type Data Pad address address sum

Destination Source Check- (b) Preamble Length Data Pad address address sum 1. Preamble - 8 octets (each 10101010) 2. Addresses - 6 bytes each. Dest. all ones address - broadcast 3. Destination address all ones implies broadcast; bit 46 used to distinguish local and global addresses; 4. Type — of payload 5. Data — upto 1500 bytes. Minimum limit ? 6. Pad — To cater for minimum packet length 7. Checksum 8. IEEE 802.3: SoF Delimiter (for compatibility), Type to Length Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 Minimum Packet Size

For 10 Mbps LAN, maximum distance of 2500 m between two stations 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 prescribes 64 bytes (512 bits) as the minimum packet size). For 100 Mbps LAN Ethernet standard recommends max length 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 Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 Binary Exponential Back-off in Ethernet

For any station time is slotted with slot duration 2τ (a slot begins at the instant a collision is sensed) After first collision, retransmit at the next slot with probability half. If collision happens again retransmit at next slot with probability 1/4 If a third collision occurs retransmit with probability 1/8, and so on 1 After r collisions, transmission probability is 2r Binary exponential back-off. After r = 10 probability does not 1 fall below 210 = 1/1024

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless 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 better technology for ethernet cards) Backward compatibility Maximum length reduced (otherwise we need to increase minimum frame size!) Why?

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 (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 Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 MACAW - MACA for Wireless

Some enhancements to MACA MAC layer acknowledgements. To receive ACK there should be no collision at the transmitter of the original packet. So exposed station problem is deliberately not addressed. CSMA for transmitting RTS Back-off algorithm for each source-destination pair instead of for each station. Additional information exchange about congestion.

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 Virtual Channel Sensing

A RTS Data

B CTS ACK

C NAV

D NAV

Time

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 802.11 Modes

DCF - Distributed Coordination Function Each determine what to do next PCF - Point Coordination Function Base station broadcasts beacon frames (10-100 times per sec) Could provide QOS guarantees Coordinator can even request nodes to go to “sleep”

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 PCF - DCF Coordination

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

Extended IFS Control frame or next fragment may be sent here

SIFS PCF frames may be sent here DCF frames may be sent here PIFS Bad frame recovery done here

DIFS

EIFS

ACK

Time

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 802.11 Frame Structure

Bytes 2 2 6 6 6 2 6 0-2312 4

Frame Dur- Address Address Address Address Check- Seq. Data control ation 1 2 3 4 sum

Bits 2 2 4 1 1 1 1 1 1 1 1

From Version Type Subtype To MF Re- Pwr More W O Frame control DS DS try

Ramkumar PL Services Provides By DL Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless 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 Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless 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 Layer PPP Framing ADSL and Cable Internet DLL Protocols Ethernet - IEEE 802.3 Other Layer 2 Components Wireless Ethernet IEEE 802.11 802.11

Upper layers

Logical link control Data link layer MAC sublayer

802.11 802.11 802.11 802.11a 802.11b 802.11g Physical Infrared FHSS DSSS OFDM HR-DSSS OFDM layer

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components A Typical LAN

Bridge Backbone LAN B B B B

File server

Cluster on a single LAN

Work- station

LAN

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Bridges

Bridges interconnect LANs (interconnect collision domains to create a ) Need for bridges LANs might have sprouted independently Sometimes (geographically well distributed) cheaper to connect different segments with a bridge than run a single cable Controlling load in each LAN Very large physical distances (greater than 2500 m) Reliability Security

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Local Internetworking

Should the frame be forwarded? To whom? Hash tables

F G H

Bridge LAN 4

A B B1 C B2 D E

LAN 1 LAN 2 LAN 3

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other 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 some knowledge of the topology

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Repeaters, Hubs, Bridges, Switches, Routers, Gateways

Application layer Application gateway

Transport layer Transport gateway Packet (supplied by network layer)

Frame Packet TCP User Network layer CRC header header header data

Data link layer Bridge, switch Frame (built by data link layer)

Physical layer Repeater, hub

(a) (b)

Ramkumar PL Services Provides By DL Layer Framing DLL Protocols Other Layer 2 Components Hubs, Bridges, Switches

A B C D A B C D A B C D Host

Hub Bridge Switch

LAN

E F G H E F G H E F G H

(a) (b) (c)

Ramkumar PL