• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
ppt
 

ppt

on

  • 2,500 views

 

Statistics

Views

Total Views
2,500
Views on SlideShare
2,500
Embed Views
0

Actions

Likes
0
Downloads
41
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Draw on board
  • Draw 0 1 0 1 = LHLH
  • Draw 0 1 0 1 = LHLH
  • 0 1 0 1 = H LH HL LH HL
  • Application may get duplicates in the case of early timeouts
  • Xxx picture
  • Draw 0 1 0 1 = LHLH

ppt ppt Presentation Transcript

  • Chapter 5 Link Layer and LANs
    • A note on the use of these ppt slides:
    • We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:
    • If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!)
    • If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material.
    • Thanks and enjoy! JFK/KWR
    • All material copyright 1996-2007
    • J.F Kurose and K.W. Ross, All Rights Reserved
    Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
  • Chapter 5: The Data Link Layer
    • Our goals:
    • understand principles behind data link layer services:
      • error detection, correction
      • sharing a broadcast channel: multiple access
      • link layer addressing
      • reliable data transfer, flow control: done!
    • instantiation and implementation of various link layer technologies
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM and MPLS
  • Link Layer: Introduction
    • Some terminology:
    • hosts and routers are nodes
    • communication channels that connect adjacent nodes along communication path are links
      • wired links
      • wireless links
      • LANs
    • layer-2 packet is a frame , encapsulates datagram
    data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
  • Adaptors Communicating
    • link and physical layers implemented in adaptor/NIC (Network Interface Card)
      • RAM, DSP chips, host bus interface, and link interface
      • Ethernet card, PCMCIA card, 802.11 card
    • sending side:
      • encapsulates datagram in a frame
      • adds error checking bits, rdt, flow control, etc.
    • receiving side
      • looks for errors, rdt, flow control, etc
      • extracts datagram, passes to upper layer at receiving side
    • datagram transferred by different link protocols over different links:
      • e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link
    sending node rcving node datagram adapter adapter link layer protocol frame frame
  • Protocol stack picture network link physical frame phys. link data link protocol adapter card application transport network link physical M M M M H t H t H n H t H n H l M H t H n H l
  • Host adaptor controller physical transmission cpu memory host bus (e.g., PCI) network adapter card host schematic application transport network link link physical
  • Link Layer Functions
    • Flow Control
      • pacing between adjacent sending and receiving nodes
    • Reliable delivery between adjacent nodes
      • we learned how to do this already (chapter 3)!
      • seldom used on low bit error link (i.e. fiber, twisted pair)
      • wireless links: high error rates
        • Eschew end-to-end principle for performance
    • Security
    • Demux to upper protocol
    • Framing
      • encapsulate datagram into frame, adding header, trailer
  • Link Layer Functions (more)
    • Error Detection
      • errors caused by signal attenuation, noise.
      • receiver detects presence of errors:
        • signals sender for retransmission or drops frame
    • Error Correction
      • receiver identifies and corrects bit error(s) without resorting to retransmission
    • Medium access and quality of service
      • channel access if shared medium
    • Addressing
      • “ MAC” addresses used in frame headers to identify source, dest (different from IP address)
  • Flow control
    • Pacing between sender and receiver
    • Sender prevented from overrunning receiver
      • Ready-To-Send, Clear-To-Send signalling
  • Reliable delivery
    • Reliability at the link layer
    • Handled in a similar manner to transport protocols
      • ARQ, Stop-and-wait, Go-back-N, Selective Repeat
    • When and why should this be used?
      • Rarely done over twisted-pair or fiber optic links
      • Usually done over lossy links for performance improvement (versus correctness)
  • Security
    • Mainly for broadcast data-link layers
      • Encrypt payload of higher layers
      • Hide IP source/destination from eavesdroppers
      • Important for wireless LANs especially
        • Parking lot attacks with 802.11b
        • WEP, WPA
    • If time permits, security will be covered at the end of the course….
  • Demux to upper protocol
    • Protocol type specification interfaces to network layer
    • Data-link layer can support any number of network layers
      • Type field in data-link header specifies network layer of packet
      • Each data-link layer defines its own protocol type numbering for network layer
      • IP is one of many network layers
  • Demux to upper protocol
    • http://www.cavebear.com/CaveBear/Ethernet/type.html
    • Some Ethernet protocol types
      • 0800 DOD Internet Protocol (IP)
      • 0806 Address Resolution Protocol (ARP)
      • 8037 IPX (Novell Netware)
      • 80D5 IBM SNA Services
      • 809B EtherTalk (AppleTalk over Ethernet)
  • Framing
    • Data encapsulation for transmission over physical link
    • Data embedded within a link-layer frame before transmission
    • Data-link header and/or trailer added
    • Physical addresses used in frame headers to identify source and destination (not IP)
  • Fixed length framing
    • Length delimited
      • Beginning of frame has length
      • Single corrupt length can cause problems
        • Must have start of frame character to resynchronize
        • Resynchronization can fail if start of frame character is inside packets as well
  • Variable length framing
    • Byte stuffing
      • Special start of frame byte (e.g. 0xFF)
      • Special escape byte value (e.g. 0xFE)
      • Values actually in text are replaced (e.g. 0xFF by 0xFEFF and 0xFE by 0xFEFE)
      • Worst case – can double the size of frame
    • Bit stuffing
      • Special bit sequence (0x01111110)
      • 0 bit stuffed after any 11111 sequence
  • Clock-Based Framing
    • Used by SONET
    • Fixed size frames (810 bytes)
    • Look for start of frame marker that appears every 810 bytes
    • Will eventually sync up
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM
  • Error detection/correction
    • Errors caused by signal attenuation, noise.
    • Receiver detects presence of errors
    • Possible actions
      • Signal sender for retransmission
      • Drops frame
      • Correct bit errors if possible and continue
  • Error Detection
    • EDC= Error Detection and Correction bits (redundancy)
    • D = Data protected by error checking, may include header fields
    • Error detection not 100% reliable!
      • protocol may miss some errors, but rarely
      • larger EDC field yields better detection and correction
  • Parity Checking Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity : Detect and correct single bit errors 0 0
  • Cyclic Redundancy Check (CRC)
    • Polynomial code
      • Treat data bits as coefficients of n-bit polynomial
      • Choose r+1 bit generator polynomial G
        • G well known – chosen in advance
      • Add r bits to packet so that message is divisible by G
        • At receiver, divide payload by generator polynomial
        • If result not zero, error detected
    • Better loss detection properties than checksums
      • All single bit errors, all double bit errors, all odd-numbered errors, burst errors less than r
    • Widely used in practice (802.11, WiFi, ATM, SCTP)
  • Cyclic Redundancy Check (CRC)
    • Calculate code using modulo 2 division of data by generator polynomial
      • Subtraction equivalent to XOR
      • Weak definition of magnitude
        • X >= Y iff position of highest 1 bit of X is the same or greater than the highest 1 bit of Y
    • Record remainder “R” after division and attach “R” after data
    • Result divisible by generator polynomial
  • Cyclic Redundancy Check (CRC)
  • CRC example
    • Data:
      • 101110
    • Generator Polynomial :
      • x 3 + 1 (1001)
    • Send :
    • 101110011
  • CRC example
    • Data:
      • 10000
    • Generator Polynomial :
      • x 2 + 1 (101)
    • Send :
    101 1000000 G
  • CRC example
    • Data:
      • 10000
    • Generator Polynomial :
      • x 2 + 1 (101)
    • Send :
    • 1000001
    101 1000000 101 010 000 100 101 010 000 100 101 01 101 D G R
  • Cyclic Redundancy Check (CRC)
    • CRC-16 implementation
    • Shift register and XOR gates
  • CRC polynomials
    • CRC-16 = x 16 + x 15 + x 2 + 1 (used in HDLC )
    • CRC-CCITT = x 16 + x 12 + x 5 + 1
    • CRC-32 = x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 (used in Ethernet )
  • Forward error correction
    • FEC
      • Use error correcting codes to repair losses
      • Add redundant information which allows receiver to correct bit errors
      • See information and coding theory work.
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM
  • Multiple Access Links and Protocols
    • Two types of “links”:
    • point-to-point
      • PPP for dial-up access
      • point-to-point link between Ethernet switch and host
    • broadcast (shared wire or medium)
      • old-fashioned Ethernet
      • upstream HFC (cable)
      • 802.11 wireless LAN
    shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical)
  • Multiple access problem
    • Point-to-point link and switched media no problem
    • Broadcast links?
      • Network arbitration
      • Give everyone a fixed time/freq slot?
        • Ok for fixed bandwidth (e.g., voice)
        • What if traffic is bursty?
      • Centralized arbiter
        • Ex: cell phone base station
        • Single point of failure
      • Distributed arbitration
        • Aloha/Ethernet
      • Humans use multiple access protocols all the time
  • Multiple access protocols
    • single shared communication channel
    • two or more simultaneous transmissions by nodes: interference
      • only one node can send successfully at a time
    • multiple access protocol:
      • distributed algorithm that determines how stations share channel, i.e., determine when station can transmit
      • communication about channel sharing uses channel itself!
      • what to look for in multiple access protocols:
        • synchronous or asynchronous
        • amount of information needed about other stations
        • robustness (e.g., to channel errors)
        • performance
  • Ideal Multiple Access Protocol
    • Broadcast channel of rate R bps
    • 1. Efficient:
      • When one node wants to transmit, it can send at rate R.
    • 2. Fair:
      • When M nodes want to transmit, each can send at average rate R/M
    • 3. Fully decentralized:
      • no special node to coordinate transmissions
      • no synchronization of clocks, slots
    • 4. Simple
  • MAC Protocols: a taxonomy
    • Three broad classes:
    • Channel Partitioning
      • divide channel into smaller “pieces” (time slots, frequency, code)
      • allocate piece to node for exclusive use
    • Random Access
      • channel not divided, allow collisions
      • “ recover” from collisions
    • “ Taking turns”
      • tightly coordinate shared access to avoid collisions
      • Nodes take turns, but nodes with more to send can take longer turns
  • Channel Partitioning MAC protocols: TDMA
    • TDMA: time division multiple access
    • channel divided into N time slots, one per user
      • access to channel in "rounds"
      • inefficient with low duty cycle users and at light load
    • each station gets fixed length slot (length = pkt trans time) in each round
    • unused slots go idle
    • example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle
    1 3 4 1 3 4 6-slot frame
  • Channel Partitioning MAC protocols: FDMA
    • FDMA: frequency division multiple access
    • channel spectrum divided into frequency bands
    • each station assigned fixed frequency band
    • unused transmission time in frequency bands go idle
    • example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle
    frequency bands time FDM cable
  • Channel Partitioning MAC protocols
    • CDMA (Code Division Multiple Access)
    • unique “code” assigned to each user; ie, code set partitioning
    • used mostly in wireless broadcast channels (cellular, satellite,etc)
    • each user has own “chipping” sequence (ie, code) to encode data
    • encoded signal = (original data) X (chipping sequence)
    • decoding: inner-product of encoded signal and chipping sequence
    • allows multiple users to “coexist” and transmit simultaneously with minimal interference (if codes are “orthogonal”)
  • Channel Partitioning MAC protocols
    • CDMA Encode/Decode
  • Channel Partitioning MAC protocols
    • CDMA: two sender interference
  • Random Access Protocols
    • When node has packet to send
      • transmit at full channel data rate R.
      • no a priori coordination among nodes
    • two or more transmitting nodes ➜ “collision”,
    • To avoid deterministic collisions: randomize
      • random access MAC protocol specifies:
        • how to detect collisions
        • how to recover from collisions (e.g., via delayed retransmissions)
        • “ Asynchronous” TDMA
    • Examples of random access MAC protocols:
      • slotted ALOHA
      • ALOHA
      • CSMA, CSMA/CD, CSMA/CA
  • Slotted ALOHA
    • Assumptions
    • all frames same size
    • time is divided into equal size slots, time to transmit 1 frame
    • nodes start to transmit frames only at beginning of slots
    • nodes are synchronized
    • if 2 or more nodes transmit in slot, all nodes detect collision
    • Operation
    • when node obtains fresh frame, it transmits in next slot
    • no collision, node can send new frame in next slot
    • if collision, node retransmits frame in each subsequent slot with prob. p until success
  • Slotted ALOHA
    • Pros
    • single active node can continuously transmit at full rate of channel
    • highly decentralized: only slots in nodes need to be in sync
    • simple
    • Cons
    • collisions, wasting slots
    • idle slots
    • nodes may be able to detect collision in less than time to transmit packet
    • clock synchronization
  • Slotted Aloha efficiency
    • Suppose N nodes with many frames to send, each transmit in slot with probability p
    • prob that node 1 has success in a slot = p(1-p) N-1
    • prob that any node has a success = Np(1-p) N-1
    • For max efficiency with N nodes, find p* that maximizes Np(1-p) N-1
    • For many nodes, take limit of Np*(1-p*) N-1 as N goes to infinity, gives 1/e = .37
    Efficiency is the long-run fraction of successful slots when there are many nodes, each with many frames to send At best: channel used for useful transmissions 37% of time!
  • Pure (unslotted) ALOHA
    • unslotted Aloha: simpler, no synchronization
    • when frame arrives
      • Send without awaiting for beginning of slot
    • collision probability increases:
      • frame sent at t 0 collides with other frames sent in [t 0 -1,t 0 +1]
  • Pure Aloha efficiency
    • P(success by given node) = P(node transmits) .
    • P(no other node transmits in [p 0 -1,p 0 ] .
    • P(no other node transmits in [p 0 ,p 0 +1]
    • = p . (1-p) (N-1) . (1-p) (N-1)
    • P(success by any of N nodes) = N p . (1-p) (N-1) . (1-p) (N-1)
    • … choosing optimum p as n -> infty ... = 1/(2e) = .18
    S = throughput = “goodput” (success rate) G = offered load = Np 0.5 1.0 1.5 2.0 0.1 0.2 0.3 0.4 Pure Aloha Slotted Aloha protocol constrains effective channel throughput!
  • CSMA (Carrier Sense Multiple Access)
    • Human analogy: don’t interrupt others!
      • Listen before transmitting
    • CSMA algorithm
      • If channel sensed idle: transmit entire frame
      • If channel sensed busy, defer transmission
        • Persistent CSMA: retry immediately with probability p when channel becomes idle
        • Non-persistent CSMA: retry after random interval
  • CSMA collisions collisions can still occur: propagation delay means two nodes may not hear each other’s transmission collision: entire packet transmission time wasted spatial layout of nodes note: role of distance & propagation delay in determining collision probability
  • CSMA/CD (Collision Detection)
    • Human analogy: the polite conversationalist
    • CSMA/CD algorithm
      • Carrier sensing, deferral as in CSMA
      • Attempt to detect collisions while sending
      • Abort colliding transmissions as soon as possible to reduce channel wastage
    • Collision detection:
      • Easy in wired LANs: measure signal strengths, compare transmitted, received signals
      • Collisions detected within short time
  • CSMA/CD collision detection
  • CSMA/CD problems
    • Can CSMA/CD work over wireless LANs?
      • Collision detection difficult in wireless LANs: receiver shut off while transmitting
      • Hidden terminal problem
  • Hidden Terminal effect
    • A, C cannot hear each other
      • obstacles, signal attenuation
      • Neither A nor C can tell if they collide at B
  • CSMA/CA: CSMA w/ collision avoidance
    • Use base CSMA
    • Add acknowledgements
      • Receiver acknowledges receipt of data
      • Avoids hidden terminal problem
    • Avoid collisions explicitly via channel reservation
      • Sender sends “request-to-send” (RTS) messages
        • Transmitted without reservation using CSMA with ACKs
      • Receiver sends “clear-to-send” (CTS) messages
        • Transmitted without reservation using CSMA with ACKs
      • Sender sends data packet using reservation
        • Explicitly indicates length of so others know how long to back off
    • Used in 802.11 wireless LAN networks
  • “Taking Turns” MAC protocols
    • Recall, channel partitioning MAC protocols:
      • share channel efficiently and fairly at high load
      • inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node!
    • Random access MAC protocols
      • efficient at low load: single node can fully utilize channel
      • high load: collision overhead
    • “ taking turns” protocols
      • look for best of both worlds!
  • “Taking Turns” MAC protocols
    • Polling:
    • master node “invites” slave nodes to transmit in turn
      • RTS, CTS messages
    • typically used with “dumb” slave devices
    • concerns:
      • polling overhead
      • latency
      • single point of failure (master)
    master slaves poll data data
  • “Taking Turns” MAC protocols
    • Token passing:
    • control token passed from one node to next sequentially.
    • token message
    • concerns:
      • token overhead
      • latency
      • single point of failure (token)
    T data (nothing to send) T
  • Taking-turns protocols
    • Distributed Polling:
    • time divided into slots
    • begins with N short reservation slots
      • reservation slot time equal to channel end-end propagation delay
      • station with message to send posts reservation
      • reservation seen by all stations
    • after reservation slots, message transmissions ordered by known priority
  • Summary of MAC protocols
    • What do you do with a shared media?
      • Channel Partitioning
        • Time Division
        • Frequency Division
        • Code Division
      • Random partitioning (dynamic),
        • ALOHA, S-ALOHA, CSMA, CSMA/CD
        • carrier sensing: easy in some technologies (wire), hard in others (wireless)
        • CSMA/CD used in Ethernet
        • CSMA/CA used in 802.11
      • Taking Turns
        • polling from a central site, token passing
        • Bluetooth, FDDI, IBM Token Ring
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM
  • MAC Addresses
    • MAC/LAN/physical/Ethernet address:
      • used to get frame from one interface to another physically-connected interface (same network)
      • Globally unique 48 bit address (for most LANs) burned in the adapter ROM
        • ifconfig –a
      • Administered by IEEE
        • manufacturer buys portion of MAC address space to assure uniqueness
  • LAN Addresses Each adapter on LAN has unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = adapter 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN (wired or wireless)
  • MAC vs IP addressing
    • MAC address
      • Flat (not hierarchical)
        • Like Social Security Numbers
        • Does not change when machine is moved (portable)
    • IP addresses
      • Hierarchically organized
        • Like postal address
        • Depends on IP subnet that node is attached to
        • Must change when machine is moved (not portable)
    • Why have separate IP and hardware addresses?
      • Assign adapters an IP address
        • Hardware only works for IP (no IPX, DECNET)
      • Use hardware address as network address
        • No route aggregation
  • ARP: Address Resolution Protocol
    • ARP
      • Broadcast interest in B’s MAC address
      • B responds with its MAC address
      • Keep track of mappings in ARP table
        • IP/MAC address mappings for LAN nodes
    • < IP address; MAC address; TTL>
        • TTL (Time To Live)
        • Soft state
    Question: how to determine MAC address of B given B’s IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 237.196.7.23 237.196.7.78 237.196.7.14 237.196.7.88
  • ARP protocol: Same LAN (network)
    • A knows B’s IP address and wants to send datagram to B, and B’s MAC address not in A’s ARP table.
    • A broadcasts ARP query packet, containing B's IP address
      • Dest MAC address = FF-FF-FF-FF-FF-FF
      • all machines on LAN receive ARP query
    • B receives ARP packet, replies to A with its (B's) MAC address
      • frame sent to A’s MAC address (unicast)
    • A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out)
      • soft state: information that times out (goes away) unless refreshed
    • ARP is “plug-and-play”:
      • nodes create their ARP tables without intervention from net administrator
        • arp –a
        • /proc/net/arp
  • Routing to another LAN
    • walkthrough: send datagram from A to B via R
    • assume A knows B’s IP address
    • Two ARP tables in router R, one for each IP network (LAN)
    • In routing table at source Host, default route 111.111.111.110
    • A creates datagram with source A, destination B
    A R B
    • A checks route table to find B is not on its network
    • A uses ARP to get R’s MAC address (ARP for 111.111.111.110)
    • A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram
    • A’s adapter sends frame
    • R’s adapter receives frame
    • R removes IP datagram from Ethernet frame, sees its destined to B
    • R uses ARP to get B’s MAC address
    • R creates frame containing A-to-B IP datagram sends to B
    A R B
  • DHCP
    • Q: How does host get an IP address on subnet?
    • hard-coded by system admin in a file
      • Wintel: control-panel->network->configuration->tcp/ip->properties
      • UNIX: /etc/rc.config
    • DHCP: D ynamic H ost C onfiguration P rotocol: dynamically get address from server
      • “ plug-and-play”
      • Given a hardware address, give me the IP address
        • Predecessors: RARP, BOOTP
        • Opposite of ARP (given IP address, give me MAC address)
  • DHCP: Dynamic Host Configuration Protocol
    • Goal: allow host to dynamically obtain its IP address from network server when it joins network
      • Allows reuse of addresses (only hold address while connected and “on”)
      • Support for mobile users who want to join network
      • Can renew its lease on address in use
    • DHCP overview:
      • host broadcasts “ DHCP discover ” msg
      • DHCP server responds with “ DHCP offer ” msg
      • host requests IP address: “ DHCP request ” msg
      • DHCP server sends address: “ DHCP ack ” msg
  • DHCP client-server scenario 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 DHCP server arriving DHCP client needs address in this (223.1.2.0/24) network A B E
  • DHCP client-server scenario DHCP server: 223.1.2.5 arriving client time DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 Lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM
  • Specific data-link layers
    • Specific data-link layers
      • Ethernet (802.3)
      • Token Ring (802.5)
      • WiFi (802.11)
      • Frame relay
      • Special link layers covered later (PPP, ATM)
  • Ethernet's implementation of data-link layer
    • Framing (special pre-amble within frame)
    • Physical addressing (6 byte hardware addresses)
    • Demux to upper protocol (type field in header)
    • Flow control (none)
    • Error detection and correction (CRC-32)
    • Reliable delivery (none)
    • Security (none)
    • Media access and quality of service (CSMA/CD with adaptive, randomized wait)
    • Digital to analog conversion (Manchester encoding)
  • Ethernet
    • “ dominant” wired LAN technology:
      • First practical local area network, built at Xerox PARC in 70’s
        • first widely used LAN technology
      • Simpler, cheaper than token LANs and ATM
        • cheap: $3 for 100Mbs NIC
    Metcalfe’s Ethernet sketch
  • Ethernet topologies
    • Flexible topologies
      • Bus topology popular through mid 90s
        • all nodes in same collision domain
        • requires the use of CSMA/CD
      • Star topology today
        • active switch in center
        • each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other)
    switch bus: coaxial cable star
  • Ethernet Frame Structure
    • Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
    • Preamble:
    • 7 bytes with pattern 10101010 followed by one byte with pattern 10101011
      • used to synchronize receiver, sender clock rates
  • Ethernet Frame Structure (more)
    • Addresses: 6 bytes
      • Globally unique, allocated to manufacturers
      • if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to net-layer protocol
      • otherwise, adapter discards frame
    • Type: indicates the higher layer protocol
      • mostly IP but others include Novell IPX and AppleTalk
    • Data – 46 to 1500 bytes
    • CRC: 4 bytes
      • checked at receiver, if error is detected, frame is dropped
      • CRC-32
        • (x 32 +x 26 +x 23 +x 22 +x 16 +x 12 +x 11 +x 10 +x 8 +x 7 +x 5 +x 4 +x 2 +x+1)
  • Unreliable, connectionless service
    • Connectionless: No handshaking between sending and receiving adapter.
    • Unreliable: receiving adapter doesn’t send acks or nacks to sending adapter
      • stream of datagrams passed to network layer can have gaps
      • gaps will be filled if app is using TCP
      • otherwise, app will see the gaps
  • Ethernet CSMA/CD algorithm
    • 1. Adaptor receives datagram from net layer & creates frame
    • 2. Carrier sensing: If adapter senses channel idle, it starts to transmit frame. If it senses channel busy, waits until channel idle and then transmits
    • 3. If adapter transmits entire frame without detecting another transmission, the adapter is done with frame !
    • 4. Collision detection: If adapter detects another transmission while transmitting, aborts and sends jam signal (make sure all adapters see collision: 48 bits)
    • 5. Random access: After aborting, adapter enters exponential backoff before returning to Step 2
      • after m th collision, choose K randomly out of {0,1,2,…2 m -1}. Wait K *512 bit times
      • first collision: choose K from {0,1}; delay is K· 512 bit transmission times
      • after second collision: choose K from {0,1,2,3}…
      • after ten collisions, choose K from {0,1,2,3,4,…,1023}
  • Exponential backoff calculation
    • Goal : adapt retransmission attempts to estimated current load
      • heavy load: random wait will be longer
      • Deterministic delay after collision
        • Collision will occur again in lockstep
      • Random delay with fixed mean
        • Few senders  needless waiting
        • Too many senders  too many collisions
      • Exponentially increasing random delay
        • Infer senders from # of collisions
        • More senders  increase wait time
    See/interact with Java applet on AWL Web site: highly recommended !
  • General Ethernet CSMA/CD Packet? Sense Carrier Discard Packet Send Detect Collision b=CalcBackoff(); wait(b); attempts++; No Yes attempts < 16 attempts == 16
  • Ethernet CSMA/CD and Packet Size
    • What if two people sent really small packets
      • How do you find collision?
      • Must have a minimum packet size
    • Min packet length > 2x max prop delay
      • If A, B are at opposite sides of link, and B starts one link prop delay after A
  • Propagation delay & packet size
    • Propagation delay determines min. packet size to prevent undetected collisions
    • Modern 10Mb Ethernet
      • Segment length to support?
        • 500m maximum segment length
        • Can add repeaters up to a maximum 5 segments (2500m)
      • Propagation delay for maximum segment
        • c in cable = 60% * c in vacuum = 1.8 x 10^8 m/s
        • ~ 12.5us one-way delay
      • Add repeater and tranceiver delay
        • To be safe IEEE specifies a 512 “bit-time” slot for Ethernet = 51.2us
        • 512 bits = 64 bytes (minimum data payload = 46 bytes)
  • Minimum packet size
    • What about scaling? 100Mbit, 1Gbit...
    • Make network smaller?
      • Solution for 100BaseT
    • Make min pkt size larger?
      • 512bits @ 1Gbps = 512ns
      • 512ns * 1.8 * 10^8 = 92meters
      • Gigabit ethernet uses collision extension for small pkts
  • Ethernet Problems
    • Ethernet unstable at high loads
    • Peak throughput worse with
      • More hosts – more collisions needed to identify single sender
      • Smaller packet sizes – more frequent arbitration
      • Longer links – collisions take longer to observe, more wasted bandwidth
  • Token Rings
    • Packets broadcast around ring
    • Token “right to send” rotates around ring
      • Fair, real-time bandwidth allocation
        • Every host holds token for limited time
        • Higher latency when only one sender
  • Token Passing: IEEE802.5 standard
    • 4 Mbps
    • max token holding time: 10 ms (limits frame length)
    • SD, ED mark start, end of packet
    • AC: access control byte:
      • token bit: value 0 means token can be seized, value 1 means data follows FC
      • priority bits: priority of packet
      • reservation bits: station can write these bits to prevent stations with lower priority packet from seizing token after token becomes free
  • Why Did Ethernet Win?
    • Better failure modes
      • Token rings – network unusable
      • Ethernet – node detached
    • Good performance in common case
    • Volume  lower cost  higher volume ….
    • Adaptable
      • To higher bandwidths (vs. FDDI)
      • To switching (vs. ATM)
    • Completely distributed, easy to maintain/administer
    • Easy incremental deployment
    • Cheap cabling, etc
  • IEEE 802.11 Wireless LAN
    • Untethered (often mobile) networking
    • IEEE 802.11 standard:
      • Defines specific implementations of data-link functions
      • Framing, error detection, MAC, etc.
      • Unlicensed frequency spectrum: 900Mhz, 2.4Ghz
  • IEEE 802.11 Ad-hoc mode
    • Ad hoc network: stations can dynamically form network without AP
    • Applications:
      • “ laptop” meeting in conference room, car
      • interconnection of “personal” devices
      • battlefield
    • IETF MANET (Mobile Ad hoc Networks) working group
  • IEEE 802.11 Infrastructure mode
    • Typically used with access point (base station)
    • Several communication methods supported
      • CSMA (with explicit ACK to indicate collision)
      • CSMA/CA: reservations
      • Polling from AP
  • IEEE 802.11 MAC Protocol: CSMA
    • 802.11 CSMA sender
    • - if sense channel idle for DIFS sec.
    • then transmit entire frame (no collision detection)
    • -if sense channel busy then backoff (random, exponential)
    • 802.11 CSMA receiver
    • -if received OK
    • return ACK after SIFS
    • SIFS < DIFS allows acks to grab channel with higher priority
    • 802.11 CSMA others
    • NAV : Network Allocation Vector
    • 802.11 frame has transmission time field
    • others (hearing data) defer access for NAV time units
  • IEEE 802.11 MAC Protocol CSMA/CA
    • Same as previous mode but with explicit channel reservation
      • Send short reservation messages via CSMA to reserve channel
        • Sender RTS (request to send), Receiver CTS (clear to send)
        • CTS notifies all hidden stations of sender's reservation
        • Short messages so that collision less likely and of short duration
      • Send data unobstructed on reserved channel
        • End result similar to CSMA/CD
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Interconnections: Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM
  • Link-layer devices
    • Q: Why not just one big LAN?
    • limited aggregate bandwidth
    • limited length: electrical limitations
    • large “collision domain” (can collide with many stations)
    • access delay (eg 802.5 token passing delay)
  • Hubs
    • Hubs are essentially physical-layer, multi-port repeaters:
      • bits coming from one link go out all other links at the same rate
      • addresses electrical limitations
      • no frame buffering
      • no CSMA/CD at hub: adapters detect collisions
        • all nodes connected to hub can collide with one another
    twisted pair hub
  • Hubs (more)
    • Hubs do not isolate collision domains: node may collide with any node residing at any segment in LAN
    • Hub Advantages:
      • simple, inexpensive device
      • extends maximum distance between node pairs
  • Interconnecting with hubs
    • Backbone hub interconnects LAN segments
    • But individual segment collision domains become one large collision domain
      • Single collision domain results in no increase in max throughput
      • Simultaneous transfers between A to A’ and B to B’ collide
      • Multi-tier throughput same as single segment throughput
    • Can’t interconnect 10BaseT & 100BaseT
    hub hub hub hub A A’ B B’
  • Switches
    • Link Layer device
      • Smarter than hubs
      • Actively stores and forwards Ethernet frames
      • Examines frame header and selectively forwards frame based on destination MAC address
      • Two-port switch known as a “bridge”
      • Switches known as “multi-port” bridges
    • A switch isolates collision domains since it buffers frames
    • Uses CSMA/CD to access individual network segments to transmit frames
      • Transparent to hosts
      • Plug-and-play, self-learning (do not need to be configured)
  • Switches: multiple simultaneous transmissions
    • Hosts have dedicated direct connection to switch
    • Ethernet protocol and frame used, but…
      • No collisions
        • Each link is its own collision domain
      • Full duplex operation
    • Switch buffers frames
    • Much greater aggregate bandwidth
      • Data backplane of switches typically large to support simultaneous transfers amongst ports
    • Switching: A-to-A’ and B-to-B’ simultaneously, no collisions
    switch A A’ B B’ C C’
  • Switches (more)
    • Switch advantages:
      • Isolates collision domains resulting in higher total max throughput
      • Can connect different type Ethernet since it is a store and forward device
      • Transparent: no need for any change to hosts LAN adapters
  • Switch operation
    • How do determine onto which LAN segment to forward frame?
      • Looks like a routing problem...
    1 2 3 hub hub hub switch
  • Self learning
    • Approach
      • Monitor traffic to build a cache ( switch table ) of which nodes are downstream of which ports
        • (MAC Address, Interface, Time Stamp)
        • learns which hosts can be reached through which interfaces
      • Selectively forward frames based on cache entries
      • Flood network for frames with unknown (MAC) destinations
  • Switch algorithm
    • When frame received:
    • 1. record link associated with sending host
    • 2. index switch table using MAC dest address
    • 3. if entry found for destination then {
    • if dest on segment from which frame arrived then drop the frame
    • else forward the frame on interface indicated
    • }
    • else flood
    forward on all but the interface on which the frame arrived
  • Switch example
    • Suppose C sends frame to D
    • Switch receives frame from from C
      • notes in bridge table that C is on interface 1
      • because D is not in table, switch forwards frame into interfaces 2 and 3
    • frame received by D
    hub hub hub switch A B C D E F G H I address interface A B E G 1 1 2 3 1 2 3 C 1
  • Switch example
    • Suppose D replies back with frame to C.
    • Switch receives frame from from D
      • notes in bridge table that D is on interface 2
      • because C is in table, switch forwards frame only to interface 1
    • frame received by C
    hub hub hub A B C D E F G H I address interface A B E G C 1 1 2 3 1 1 2 3 switch D 2
  • Switch: traffic isolation
    • switch installation breaks subnet into LAN segments
    • switch filters packets:
      • same-LAN-segment frames not usually forwarded onto other LAN segments
      • segments become separate collision domains
    collision domain collision domain collision domain hub hub hub switch
  • Switches and Spanning Trees
    • for increased reliability, desirable to have redundant, alternate paths from source to destination
    • with multiple simultaneous paths, cycles result - bridges may multiply and forward frame forever
    • solution: organize switches in a spanning tree by disabling subset of interfaces
    switch switch Disabled
  • Switches vs. Routers
    • both store-and-forward devices
      • routers: network layer devices (examine network layer headers)
      • switches/bridges are link Layer devices
    • routers maintain routing tables, implement routing algorithms
    • swtiches maintain filtering tables, implement filtering, learning and spanning tree algorithms
  • Routers vs. Switches
    • Switches + and -
    • + Switch operation is simpler requiring less processing bandwidth
    • - Topologies are restricted with switches: avoid cycles with spanning trees
    • - Switches do not offer protection from broadcast storms (endless broadcasting by a host will be forwarded by a switch)
  • Routers vs. Switches
    • Routers + and -
    • + arbitrary topologies can be supported, cycling is limited by TTL counters (and good routing protocols)
    • - require IP address configuration (not plug and play)
    • - require higher processing bandwidth
    • switches do well in small (few hundred hosts) while routers used in large networks (thousands of hosts)
  • Summary comparison
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM
  • Point to Point Data Link Control
    • Point-to-point links
      • One sender, one receiver, one link
      • Easier than shared broadcast links
        • No media access control
        • No need for explicit MAC addressing (ie ARP)
    • Goal of Point-to-Point protocols
      • Layer generic “higher-level” data-link layer functions on top of a variety of point-to-point links
        • Dial-up phone line, DSL, ISDN etc.
        • Each different link does its own digital-analog conversion (ie provides bits)
        • Implement pseudo-link layer on top that implements common functions
          • Framing, Demux to upper layer, etc.
    • Examples
      • PPP (point-to-point protocol)
      • HDLC: High level data link control (Data link used to be considered “high layer” in protocol stack!)
  • PPP Design Requirements [RFC 1557]
    • packet framing: encapsulation of network-layer datagram in data link frame
      • carry network layer data of any network layer protocol (not just IP) at same time
    • demultiplex upwards
    • bit transparency: must carry any bit pattern in the data field
    • error detection (no correction)
    • connection liveness: detect, signal link failure to network layer
    • network layer address negotiation: endpoint can learn/configure each other’s network address
  • PPP non-requirements
    • no error correction/recovery
    • no flow control
    • out of order delivery OK
    • no need to support multipoint links (e.g., polling)
    Error recovery, flow control, data re-ordering all relegated to higher layers!
  • PPP Data Frame
    • Flag: delimiter (framing)
    • Address: does nothing (only one option)
    • Control: does nothing; in the future possible multiple control fields
    • Protocol: upper layer protocol to which frame delivered (eg, PPP-LCP, IP, IPCP, etc)
  • PPP Data Frame
    • info: upper layer data being carried
    • check: cyclic redundancy check for error detection
  • Byte Stuffing
    • “ data transparency” requirement: data field must be allowed to include flag pattern <01111110>
      • Q: is received <01111110> data or flag?
    • Sender:
      • adds (“stuffs”) extra < 01111101> byte before each <01111110> data byte
      • adds (“stuffs”) extra < 01111101> byte before each <01111101> data byte
    • Receiver:
      • 01111101 byte followed by 01111110 byte: discard first byte, continue data reception
      • single 01111110: flag byte
  • Byte Stuffing flag byte pattern in data to send flag byte pattern plus stuffed byte in transmitted data
  • 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
  • Link Layer
    • 5.1 Introduction and services
    • 5.2 Error detection and correction
    • 5.3Multiple access protocols
    • 5.4 Link-Layer Addressing
    • 5.5 Ethernet and other data link layers
    • 5.6 Hubs and switches
    • 5.7 PPP
    • 5.8 Link Virtualization: ATM and MPLS
  • Virtualization of networks
    • Virtualization of resources: a powerful abstraction in systems engineering:
    • computing examples: virtual memory, virtual devices
      • Virtual machines: e.g., java
      • IBM VM os from 1960’s/70’s
    • layering of abstractions: don’t sweat the details of the lower layer, only deal with lower layers abstractly
  • The Internet: virtualizing networks
    • 1974: multiple unconnected nets
      • ARPAnet
      • data-over-cable networks
      • packet satellite network (Aloha)
      • packet radio network
    • … differing in:
      • addressing conventions
      • packet formats
      • error recovery
      • routing
    ARPAnet satellite net &quot;A Protocol for Packet Network Intercommunication&quot;, V. Cerf, R. Kahn, IEEE Transactions on Communications, May, 1974, pp. 637-648.
  • The Internet: virtualizing networks
    • Gateway:
    • “ embed internetwork packets in local packet format or extract them”
    • route (at internetwork level) to next gateway
    ARPAnet satellite net gateway
    • Internetwork layer (IP):
    • addressing: internetwork appears as a single, uniform entity, despite underlying local network heterogeneity
    • network of networks
  • Cerf & Kahn’s Internetwork Architecture
    • What is virtualized?
    • two layers of addressing: internetwork and local network
    • new layer (IP) makes everything homogeneous at internetwork layer
    • underlying local network technology
      • cable
      • satellite
      • 56K telephone modem
      • today: ATM, MPLS
    • … “ invisible” at internetwork layer. Looks like a link layer technology to IP!
  • Virtual links and tunneling
    • Many options of encapsulating or tunneling packets through a “virtual link” (VPN)
      • Generic Routing Encapsulation (GRE)
        • PPTP (Point-to-point Tunneling Protocol)
        • L2F (Layer 2 Forwarding)
        • L2TP (Layer 2 Tunneling Protocol)
    • Can also be done at network layer via IPsec
      • Encrypt data at a layer below network layer
      • Works for IP packets
  • Virtual links example
    • Treat IP-to-IP session as a virtual LAN link
      • IP_local = IP addr. of client at home assigned by ISP
      • IP_work = IP addr. of client for use in accessing work LAN
      • IP_file_serv = IP addr. of protected file server at work
        • ACL to only allow access from work LAN
      • IP_VPN_serv = IP addr. of VPN server at work
        • Authenticates remote client via username/password
        • Assigns remote client an IP address on LAN (IP_work)
        • Responds to ARPs for IP_remote on behalf of client
        • Decapsulates and encapsulates packets to/from client
    IP Dst = IP_VPN_serv IP Src = IP_local IP Src = IP_work IP Src = IP_file_serv IP Src = IP_work IP Src = IP_file_serv VPN server terminates tunnel
  • ATM and MPLS
    • ATM, MPLS separate networks in their own right
      • different service models, addressing, routing from Internet
    • viewed by Internet as logical link connecting IP routers
      • just like dialup link is really part of separate network (telephone network)
  • Multiprotocol label switching (MPLS)
    • initial goal: speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding
      • borrowing ideas from Virtual Circuit (VC) approach
      • but IP datagram still keeps IP address!
    Data-link header IP header remainder of payload MPLS header label Exp S TTL 20 3 1 5
  • MPLS capable routers
    • a.k.a. label-switched router
    • forwards packets to outgoing interface based only on label value (don’t inspect IP address)
      • MPLS forwarding table distinct from IP forwarding tables
    • signaling protocol needed to set up forwarding
      • RSVP-TE
      • forwarding possible along paths that IP alone would not allow (e.g., source-specific routing) !!
      • use MPLS for traffic engineering
    • must co-exist with IP-only routers
  • MPLS forwarding tables R1 R2 D R3 R4 R5 0 1 0 0 A R6 in out out label label dest interface 10 A 0 12 D 0 1 0 8 A 1 in out out label label dest interface 6 - A 0 in out out label label dest interface 10 6 A 1 12 9 D 0 in out out label label dest interface 8 6 A 0
  • Chapter 5: Summary
    • principles behind data link layer services:
      • error detection, correction
      • sharing a broadcast channel: multiple access
      • link layer addressing
    • instantiation and implementation of various link layer technologies
      • Ethernet
      • switched LANS
      • PPP
      • virtualized networks as a link layer: ATM, MPLS
  • Physical Layer
    • Functions
      • Digital to Analog conversion
      • Physical media characteristics
  • Digital to analog conversion
    • Bits sent as analog signals
      • Photonic pulses of a given wavelength over optical fiber
      • Electronic signals of a given voltage
  • Digital to analog conversion
    • Will cover electronic transmission (optical transmission left for you to research)
    • Biggest issue
      • When to sample voltage?
      • Detecting sequences involves clocking with the same clock
        • How to synchronize sender and receiver clocks?
      • Need easily detectible event at both ends
        • Signal transitions help resync sender and receiver
        • Need frequent transitions to prevent clock skew
      • http://www.mouse.demon.nl/ckp/telco/encode.htm
  • NRZ-L
    • Non-Return to Zero Level (NRZ-L)
      • 1=high signal, 0=lower signal
      • Long sequence of same bit causes difficulty
        • DC bias hard to detect – low and high detected by difference from average voltage
        • Clock recovery difficult
      • Used by Synchronous Optical Network (SONET)
        • SONET XOR’s bit sequence to ensure frequent transitions
      • Used in early magnetic tape storage
  • NRZ-L
  • NRZ-M
    • Non-Return to Zero Mark
      • Less power to transmit versus NRZ
      • 1=signal transition at start of bit, 0=no change
      • No problem with string of 1’s
      • NRZ-like problem with string of 0’s
      • Used in SDLC (Synchronous Data Link Control)
      • Used in modern magnetic tape storage
  • Manchester (Bi-Phase-Level) coding
    • Manchester
      • 0=low to high transition, 1=high to low transition
      • Transition for every bit simplifies clock recovery
      • Not very efficient
        • Doubles the number of transitions
        • Circuitry must run twice as fast
      • Used by Ethernet
  • Manchester coding
    • Encoding for 110100
    Bit stream 1 1 0 1 0 0 Manchester encoding
  • Physical Layer
    • Plethora of physical media
      • Fiber, copper, air
      • Specifies the characteristics of transmission media
      • Too many to cover in detail, not the focus of the course
      • Many data-link layer protocols (i.e. Ethernet, Token-Ring, FDDI. ATM run across multiple physical layers)
      • Physical characteristics dictate suitability of data-link layer protocol and bandwidth limits
  • Common Cabling
    • Copper
      • Twisted Pair
        • Unshielded (UTP)
          • CAT-1, CAT-2, CAT-3, CAT-4, CAT-5, CAT-5e
        • Shielded (STP)
      • Coaxial Cable
    • Fiber
      • Single-mode
      • Multi-mode
  • Twisted Pair
    • Most common LAN interconnection
    • Multiple pairs of twisted wires
    • Twisting to eliminate interference
      • More twisting = Higher data rates, higher cost
  • Twisted pair
    • Standards specify twisting, resistance, and maximum cable length for use with particular data-link layer
    • 5 categories
      • Category 1
        • Voice only (telephone wire)
      • Category 2
        • Data to 4Mbs (LocalTalk)
      • Category 3
        • Data to 10Mbs (Ethernet)
      • Category 4
        • Data to 20Mbs (16Mbs Token Ring)
      • Category 5 (100 MHz)
        • Data to 100Mbs (Fast Ethernet)
      • Category 5e (350 MHz)
        • Data to 1000Mbs (Gigabit Ethernet)
  • Twisted Pair
    • Common connectors for Twisted Pair
      • RJ11 (3 pairs)
        • Phone connections
      • RJ45 (4 pairs)
        • Allows both data and phone connections
          • (1,2) and (3,6) for data
          • (4,5) for voice
          • (7,8) unused
        • Crossover cables for NIC-NIC, Hub-Hub connection (Data pairs swapped)
  • UTP
    • Unshielded Twisted Pair
      • Limited amount of protection from interference
      • Commonly used for voice and ethernet
        • Voice: multipair 100-ohm UTP
  • STP
    • Shielded Twisted Pair
      • Not as common at UTP
      • UTP susceptible to radio and electrical interference
      • Extra shielding material added
      • Cables heavier, bulkier, and more costly
      • Often used in token ring topologies
        • 150 ohm STP two pair (IEEE 802.5 Token Ring)
  • Coaxial cable
    • Two concentric copper conductors
      • Bidirectional
    • Separated by plastic insulation layer
      • Support longer connectivity distances over UTP
    • Used in CATV networks
      • HFC networks (Hybrid Fiber/Coax)
        • Fiber from cable headend to location near home
        • Coax to home
      • FDM to support multiple data channels
  • Fiber
    • Transmit light pulses vs. electronic signals
      • Immune to electromagnetic noise/interference
      • high-speed point-to-point transmission (e.g., 10’s-100’s Gps)
      • Low error rate
    • Cabling
      • Center core made of glass or plastic fiber
      • Plastic coating to cushion core
      • Kevlar fiber for strength
      • Teflon or PVC outer insulating jacket
  • Fiber
    • Single-mode fiber
      • Smaller diameter (12.5 microns)
      • One mode only
      • Preserves signal better over longer distances
      • Typically used for SONET or SDH
      • Lasers used to signal
    • Multi-mode fiber
      • Larger diameter (62.5 microns)
      • Multiple modes
      • WDM and DWDM = (dense) wavelength division multiplexing
    • Photodiodes at receivers
  • Physical-link lingo
    • Specifies capacities over physical media
    • Electronic
      • T1/DS1=1.54 Mbps
      • T3/DS3=45Mbps
    • Optical (OC=optical carrier)
      • OC1=52 Mbps
      • OC3/STM1=156 Mbps
      • OC12=622 Mbps
      • OC48=2488 Mbps
      • OC192=10 Gbps
      • OC768=40 Gbps
  • Wireless
    • Entire spectrum of transmission frequency ranges
      • Radio
      • Infrared
      • Lasers
      • Cellular telephone
      • Microwave
      • Satellite
      • Acoustic (see ESE sensors)
      • Ultra-wide band
    • propagation environment effects:
      • reflection
      • obstruction by objects
      • interference
    • http://www.ntia.doc.gov/osmhome/allochrt.html
  •  
  • What runs on them? Protocol Summary Protocol Cable Speed Topology Ethernet Twisted Pair, Coaxial, Fiber 10 Mbps Linear Bus, Star, Tree Fast Ethernet Twisted Pair, Fiber 100 Mbps Star LocalTalk Twisted Pair .23 Mbps Linear Bus or Star Token Ring Twisted Pair 4 Mbps - 16 Mbps Star-Wired Ring FDDI Fiber 100 Mbps Dual ring ATM Twisted Pair, Fiber 155-2488 Mbps Linear Bus, Star, Tree
  • Extra slides
  • ARQ
    • Automatic Repeat Request (ARQ)
      • Receiver sends acknowledgement (ACK) when it receives packet
      • Sender waits for ACK and timeouts if it does not arrive within some time period
  • Stop and Wait Time Timeout Sender Receiver Packet ACK
    • Simplest ARQ protocol
    • Send a packet, stop and wait until acknowledgement arrives
  • Recovering from Error ACK Timeout Packet Timeout Timeout Timeout Time Timeout Timeout ACK lost Packet lost Early timeout Packet ACK Packet Packet ACK Packet ACK Packet ACK
  • Stop and Wait Problems
    • How to recognize a duplicate?
    • Performance
      • Can only send one packet per round trip
  • How to Recognize Resends?
    • Use sequence numbers
      • both packets and acks
    • Sequence # in packet is finite -- how big should it be?
      • For stop and wait?
    • One bit – won’t send seq #1 until received ACK for seq #0
    Pkt 0 Pkt 1 Pkt 0 ACK 0 ACK 1 ACK 0
  • How to Keep the Pipe Full?
    • Send multiple packets without waiting for first to be acked
      • Number of pkts in flight = window
    • How large a window is needed
      • Round trip delay * bandwidth = capacity of pipe
    • Reliable, unordered delivery
      • Several parallel stop & waits
      • Send new packet after each ack
      • Sender keeps list of unack’ed packets; resends after timeout
      • Receiver same as stop&wait
  • Sliding Window
    • Reliable, ordered delivery
    • Receiver has to hold onto a packet until all prior packets have arrived
    • Sender must prevent buffer overflow at receiver
    • Circular buffer at sender and receiver
      • Packets in transit <= buffer size
      • Advance when sender and receiver agree packets at beginning have been received
  • Sender/Receiver State … … Sent & Acked Sent Not Acked OK to Send Not Usable … … Max acceptable Receiver window Max ACK received Next seqnum Received & Acked Acceptable Packet Not Usable Sender window Next expected Receiver Sender
  • Window Sliding – Common Case
    • On reception of new ACK (i.e. ACK for something that was not acked earlier
      • Increase sequence of max ACK received
      • Send next packet
    • On reception of new in-order data packet (next expected)
      • Hand packet to application
      • Send cumulative ACK – acknowledges reception of all packets up to sequence number
      • Increase sequence of max acceptable packet
  • Loss Recovery
    • On reception of out-of-order packet
      • Send nothing (wait for source to timeout)
      • Cumulative ACK (helps source identify loss)
    • Timeout (Go Back N recovery)
      • Set timer upon transmission of packet
      • Retransmit max ACK received sequence + 1
      • Restart from max ACK received sequence + 1
    • Performance during loss recovery
      • No longer have an entire window in transit
      • Can have much more clever loss recovery
        • Covered in TCP lectures
  • Sequence Numbers
    • How large do sequence numbers need to be?
      • Must be able to detect wrap-around
      • Depends on sender/receiver window size
    • E.g.
      • Max seq = 7, send win=recv win=7
      • If pkts 0..6 are sent succesfully and all acks lost
        • Receiver expects 7,0..5, sender retransmits old 0..6
    • Max sequence must be >= send window + recv window
  • Checksumming: Cyclic Redundancy Check
    • view data bits, D , as a binary number
    • choose r+1 bit pattern (generator), G
    • goal: choose r CRC bits, R , such that
      • <D,R> exactly divisible by G (modulo 2)
      • receiver knows G, divides <D,R> by G. If non-zero remainder: error detected!
      • can detect all burst errors less than r+1 bits
    • widely used in practice (ATM, HDCL)
  • RZ
    • Return to Zero (RZ)
      • 1=pulse to high, dropping back to low
      • 0=no transition
  • NRZ-S
    • Non-Return to Zero Space
      • 1=no change, 0=signal transition at start of bit
      • No problem with string of 0’s
      • NRZ-like problem with string of 1’s
  • Manchester encoding
    • Used in 10BaseT
    • Each bit has a transition
    • Allows clocks in sending and receiving nodes to synchronize to each other
      • no need for a centralized, global clock among nodes!
    • Hey, this is physical-layer stuff!
      • More later
  • Other coding schemes
    • Bi-Phase-Mark, Bi-Phase-Space
      • Level change at every bit period boundary
      • Mid-period transition determines bit
        • Bi-Phase-M: 0=no change, 1=signal transition
        • Bi-Phase-S: 0=signal transition, 1=no change
  • Other coding schemes
    • Differential Bi-Phase-Space, Differential Bi-Phase-Mark
      • Level change at every mid-bit period boundary
      • Bit period boundary transition determines bit
        • Diff-Bi-Phase-M: 0=signal transition, 1=no change
        • Diff-Bi-Phase-S: 0=no change, 1=signal transition
  • 802.3 Ethernet Standards: Link & Physical Layers
    • many different Ethernet standards
      • common MAC protocol and frame format
      • different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10G bps
      • different physical layer media: fiber, cable
    MAC protocol and frame format 100BASE-TX 100BASE-T4 100BASE-FX 100BASE-T2 100BASE-SX 100BASE-BX application transport network link physical fiber physical layer copper (twisted pair) physical layer
  • 10BaseT and 100BaseT
    • 10/100 Mbps rate; latter called “fast ethernet”
      • T stands for Twisted Pair
    • Originally, half-duplex mode
      • Bus topology popular through mid 90s (10Base2, co-ax)
      • Eventually, nodes connect to a hub: “star topology”; 100 m max distance between nodes and hub
      • Nodes at both ends of link can not transmit at same time
      • Nodes can not transmit and receive at same time
    • Today, mostly full-duplex
      • Nodes connect to switches
      • Simultaneous xmit and receive
    twisted pair hub
  • Gbit Ethernet
    • uses standard Ethernet frame format
    • allows for point-to-point links and shared broadcast channels
    • in shared mode, CSMA/CD is used; short distances between nodes required for efficiency
    • Full-Duplex at 1 Gbps for point-to-point links
      • Nodes can transmit and receive at 1Gbps simultaneously
    • 10 Gbps now !
  • Backbone Bridge
  • Interconnection Without Backbone
    • Not recommended for two reasons:
      • - single point of failure at Computer Science hub
      • - all traffic between EE and SE must path over CS segment
  • CSMA/CD efficiency
    • T prop = max prop delay between 2 nodes in LAN
    • t trans = time to transmit max-size frame
    • efficiency goes to 1
      • as t prop goes to 0
      • as t trans goes to infinity
    • better performance than ALOHA: and simple, cheap, decentralized !
  • More on Switches
    • cut-through switching: frame forwarded from input to output port without first collecting entire frame
      • slight reduction in latency
    • combinations of shared/dedicated, 10/100/1000 Mbps interfaces
  • Institutional network hub hub hub switch to external network router IP subnet mail server web server
  • Ethernet: uses CSMA/CD
    • if packet
    • then {
    • A: sense channel
      • if idle
      • then {
      • transmit and monitor the channel;
          • if detect another transmission
          • then {
          • abort and send jam signal;
            • update # collisions;
            • delay as required by exponential backoff algorithm;
            • goto A
            • }
          • else {done with the frame; set collisions to zero}
        • }
      • else {wait until ongoing transmission is over and goto A }
    • }
  • 10Base2 Ethernet
    • Sifting through the jargon (10Base2)
      • 10: 10Mbps; 2: under 200 meters max cable length
      • thin coaxial cable in a bus topology
    • repeaters used to connect up to multiple segments
    • repeater repeats bits it hears on one interface to its other interfaces: physical layer device only!
  • ATM
    • ATM
      • Replace existing Internet protocols with a more “robust” architecture
      • Network architecture to support
        • Multiple service classes and per-flow guarantees
        • Virtual circuits to support real-time applications
        • Explicit rate signaling and resource allocation
    • Covered as a data-link layer…
  • Internet vs. ATM
    • Internet
      • “ elastic” datagram service, no strict timing req.
      • Computer communication only
      • “ smart” end systems (computers)
        • can adapt, perform control, error recovery
        • simple inside network, complexity at “edge”
      • many link types
        • different characteristics
        • uniform service difficult
    • ATM
      • evolved from telephony, strict timing and reliability requirements
      • Computer and human communication
        • need for guaranteed service
      • “ dumb” end systems
        • telephones
        • complexity inside network
  • Asynchronous Transfer Mode (ATM)
    • 1980s/1990’s standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architecture
    • Take strengths of IP, learn from its shortcomings
      • Packet switching good
      • Packet switching without explicit network-level connections and reservations bad
      • Packet switching using large headers for small packets bad (voice)
      • Design new network to address emerging applications while allowing for efficient support for non-real-time data applications
    • Goal: integrated, end-end transport of carry voice, video, data
      • meeting timing/QoS requirements of voice, video (versus Internet best-effort model)
      • “ next generation” telephony: technical roots in telephone world
      • packet-switching (fixed length packets, called “cells”) using virtual circuits
    • Covered now since it is used mostly as a data-link layer
  • ATM architecture
    • adaptation layer: only at edge of ATM network
      • data segmentation/reassembly
      • roughly analagous to Internet transport layer
    • ATM layer: “network” layer
      • cell switching, routing
    • physical layer
  • ATM: network or link layer?
    • Vision: end-to-end transport: “ATM from desktop to desktop”
      • ATM is a network technology
    • Reality: used to connect IP backbone routers
      • “ IP over ATM”
      • ATM as switched link layer, connecting IP routers
    ATM network IP network
  • ATM Adaptation Layer (AAL)
    • ATM Adaptation Layer (AAL): “adapts” upper layers (IP or native ATM applications) to ATM layer below
    • AAL present only in end systems , not in switches
    • AAL layer segment (header/trailer fields, data) fragmented across multiple ATM cells
      • analogy: TCP segment in many IP packets
  • ATM Adaptation Layer (AAL) [more]
    • Different versions of AAL layers, depending on ATM service class:
    • AAL1: for CBR (Constant Bit Rate) services, e.g. circuit emulation
    • AAL2: for VBR (Variable Bit Rate) services, e.g., MPEG video
    • AAL5: for data (eg, IP datagrams)
    AAL PDU ATM cell User data
  • ATM Layer
    • Service: transport cells across ATM network
    • analogous to IP network layer
    • very different services than IP network layer
    Network Architecture Internet ATM ATM ATM ATM Service Model best effort CBR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes yes no no Order no yes yes yes yes Timing no yes yes no no Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ?
  • ATM Layer: Virtual Circuits
    • VC transport: cells carried on VC from source to dest
      • call setup, teardown for each call before data can flow
      • each packet carries VC identifier (not destination ID)
      • every switch on source-dest path maintain “state” for each passing connection
      • link,switch resources (bandwidth, buffers) may be allocated to VC: to get circuit-like perf.
    • Permanent VCs (PVCs)
      • long lasting connections
      • typically: “permanent” route between to IP routers
    • Switched VCs (SVC):
      • dynamically set up on per-call basis
  • ATM VCs
    • Advantages of ATM VC approach:
      • QoS performance guarantee for connection mapped to VC (bandwidth, delay, delay jitter)
    • Drawbacks of ATM VC approach:
      • Inefficient support of datagram traffic
      • one PVC between each source/dest pair) does not scale (N*2 connections needed)
      • SVC introduces call setup latency, processing overhead for short lived connections
  • ATM Layer: ATM cell
    • 5-byte ATM cell header
    • 48-byte payload
      • Why?: small payload -> short cell-creation delay for digitized voice
      • halfway between 32 and 64 (compromise!)
    Cell header Cell format
  • ATM cell header
    • VCI: virtual channel ID
      • will change from link to link thru net
    • PT: Payload type (e.g. RM cell versus data cell)
    • CLP: Cell Loss Priority bit
      • CLP = 1 implies low priority cell, can be discarded if congestion
    • HEC: Header Error Checksum
      • cyclic redundancy check
  • ATM Physical Layer (more)
    • Two pieces (sublayers) of physical layer:
    • Transmission Convergence Sublayer (TCS): adapts ATM layer above to PMD sublayer below
    • Physical Medium Dependent: depends on physical medium being used
    • TCS Functions:
      • Header checksum generation: 8 bits CRC
      • Cell delineation
      • With “unstructured” PMD sublayer, transmission of idle cells when no data cells to send
  • ATM Physical Layer
    • Physical Medium Dependent (PMD) sublayer
    • SONET/SDH : transmission frame structure (like a container carrying bits);
      • bit synchronization;
      • bandwidth partitions (TDM);
      • several speeds: OC3 = 155.52 Mbps; OC12 = 622.08 Mbps; OC48 = 2.45 Gbps, OC192 = 9.6 Gbps
    • TI/T3 : transmission frame structure (old telephone hierarchy): 1.5 Mbps/ 45 Mbps
    • unstructured : just cells (busy/idle)
  • IP-Over-ATM
    • Classic IP only
    • 3 “networks” (e.g., LAN segments)
    • MAC (802.3) and IP addresses
    • IP over ATM
    • replace “network” (e.g., LAN segment) with ATM network
    • ATM addresses, IP addresses
    ATM network Ethernet LANs Ethernet LANs
  • IP-Over-ATM AAL ATM phy phy Eth IP ATM phy ATM phy app transport IP AAL ATM phy app transport IP Eth phy
  • Datagram Journey in IP-over-ATM Network
    • at Source Host:
      • IP layer maps between IP, ATM dest address (using ARP)
      • passes datagram to AAL5
      • AAL5 encapsulates data, segments cells, passes to ATM layer
    • ATM network: moves cell along VC to destination
    • at Destination Host:
      • AAL5 reassembles cells into original datagram
      • if CRC OK, datagram is passed to IP
  • IP-Over-ATM
    • Issues:
    • IP datagrams into ATM AAL5 PDUs
    • from IP addresses to ATM addresses
      • just like IP addresses to 802.3 MAC addresses!
    ATM network Ethernet LANs
  • ATM and “IP switching”
    • ATM advantages
      • Lookup of VCID = O(1), Lookup of IP routes O(log n)
      • One-time route lookup and circuit establishment, all subsequent traffic switched
    • ATM disadvantages
      • Complex signaling and routing for establishing communication
      • Difficulty in mapping IP traffic dynamically onto ATM circuits
    • Goal
      • Maintain IP infrastructure
      • Accelerate it with labels to support O(1) lookups a la ATM
    • Solution
      • Ipsilon and “IP switching”
      • http://pnewman.org/papers/infocom96.pdf
  • IP over ATM versus IP switching IP network control IP routing ATM network control ATM label switching IP network control IP routing IP network control IP routing IP network control ATM label switching IP network control IP routing
  • ATM and “IP switching”
    • In a nutshell
      • Start with ATM switch
      • Rip out ATM signaling and routing
      • Add IP routing software
      • Add Flow classifier to map unknown flows to underlying ATM virtual circuit ID
      • Attach VCID and allow downstream nodes to do the same
    • Operation
      • Upon arrival of first packet in flow
        • Record unknown incoming VCID
        • Lookup IP flow and map it to an outgoing virtual circuit ID (label) using IP routing software
        • Create incomingVCID to outgoingVCID table entry for subsequent packets
      • Subsequent packets
        • Switched in hardware using VCID after flow classified at edge
        • IP packet forwarding done as label index lookup O(1) versus IP route lookup O(log n)
  • ATM and “IP switching”
    • Later generalized as MPLS (multi-protocol label switching)
      • “ Layer 2 ½”
      • Not tied to ATM
      • Extensible to IPv6
      • Half-way in between data-link addresses and IP addresses
        • Labeling done within a cloud versus link-local (data-link addresses) and global (IP addresses)
      • http://www.rfc-editor.org/rfc/rfc3031.txt
    • Used as a tool for traffic engineering
      • http://www.rfc-editor.org/rfc/rfc2702.txt
  • X.25 and Frame Relay
    • Like ATM:
    • wide area network technologies
    • virtual circuit oriented
    • origins in telephony world
    • Not really a link layer but....
      • Viewed as link layers by IP protocol
      • Used mostly to carry IP datagrams between IP routers
    • Going the way of the dinosaurs....
  • X.25
    • X.25 builds VC between source and destination for each user connection
    • Per-hop control along path
      • error control (with retransmissions) on each hop using LAP-B
        • variant of the HDLC protocol
        • developed when bit error rates over long-haul copper links were orders of magnitude higher
      • per-hop flow control using credits
        • congestion arising at intermediate node propagates to previous node on path
        • back to source via back pressure
  • IP versus X.25
    • X.25: reliable in-sequence end-end delivery from end-to-end
      • “ intelligence in the network”
      • built for dumb terminals accessing mainframes
    • IP: unreliable, out-of-sequence end-end delivery
      • “ intelligence in the endpoints”
    • 2000
      • gigabit routers: limited processing possible
      • CPU capacity at end-hosts
      • IP wins
  • Frame Relay
    • Designed in late ‘80s, widely deployed in the ‘90s
      • Second-generation X.25
    • Frame relay service:
      • no error control
      • no flow control
      • End-to-end congestion control
      • Some QoS mechanisms
  • Frame Relay (more)
    • Designed to interconnect corporate customer LANs
      • typically permanent VC’s: “ pipe ” carrying aggregate traffic between two routers
      • switched VC’s: as in ATM
    • corporate customer leases FR service from public Frame Relay network (eg, Sprint, ATT)
  • Frame Relay (more)
    • Flag bits, 01111110, delimit frame
    • address:
      • 10 bit VC ID field
      • 3 congestion control bits
        • FECN: forward explicit congestion notification (frame experienced congestion on path)
        • BECN: congestion on reverse path
        • DE: discard eligibility
      • Precursor to IP DiffServ and ECN
    address flags data CRC flags
  • Frame Relay -VC Rate Control
    • Committed Information Rate (CIR)
      • defined, “guaranteed” for each VC
      • negotiated at VC set up time
      • customer pays based on CIR
    • DE bit: Discard Eligibility bit
      • Edge FR switch measures traffic rate for each VC; marks DE bit
      • DE = 0: high priority, rate compliant frame; deliver at “all costs”
      • DE = 1: low priority, eligible for discard when congestion
      • Precursor to IP DiffServ
      • Can be used to support higher layer QoS mechanisms
  • Coaxial cable
    • Thick (10Base5)
      • Large diameter 50-ohm cable
      • N connectors
    • Thin (10Base2) cables
      • Small diameter 50-ohm cable
      • BNC, RJ-58 connector
    • Video cable
      • 75-ohm cable
      • BNC, RJ-59 connector
      • Not compatible with RJ-58
  • Fiber connectors
    • ESCON
    • Duplex SC
    • ST
    • MT-RJ (multimode)
    • Duplex LC