BDC CH4: Data Link Layer

CH4: Data Link Layer

Introduction

  • Data-link layer of a broadcast link
    • Data Link Control Sublayer + Media Access Control Sublayer
  • Pass through Router
    • MAC address change
    • IP address do not change
  • Pass through Switch
    • MAC address do not change
    • IP address do not change

Media Access Control (MAC) Address

  • Unicast (One to One, Individual)
    • Universally administered (廠商設定)
      • x0/4/8/C-xx-xx-xx-xx-xx
    • Locally adminstered (本地設定)
      • x2/6/A/E-xx-xx-xx-xx-xx
  • Multicast (One to Many or Many to Many, Group) -> 可以到subnet (same group)
    • Universally administered
      • x1/5/9/D-xx-xx-xx-xx-xx
    • Locally adminstered
      • x3/7/B/F-xx-xx-xx-xx-xx
  • Broadcast address would be FF-FF-FF-FF-FF-FF
  • A broadcast frame will be flooded & forwared to the other nodes in the network
  • OUI (Organizationally Unique Identifier)
    • A 24-bit number that uniquely identifies its vendor or manufactuer (ex. Prefix)
    • MAC可經由手動更改,故不可完全相信

Adress Resolution Protocol (ARP)

  • ARP request is broadcast
  • ARP reply is unicast
  • Linux / wired network
    • Source hardware address (Source MAC address)
    • Source protocol address (Who ask -> IP address)
    • Destination hardware address
      • Empty in request (要先經由ARP得知)
    • Destination protocol address (Answer to whom -> IP address)

Ethernet

  • Layer 2 data-link
  • Unit used in network communicating over Ethernet is called ‘‘Frame’’
    • Data link protocol, containing Ethernet header and payload
  • Transmission Medium
    • (legacy) Coaxial Cable
    • (common) Twisted pair cable
    • (common) Fiber optic cable

補充資料

  • Fast Ethernet
    • IEEE 802.3u standard
    • When working in half-duplex mode
      • Requires Carrier Sense Multiple Access with Collision Detection (CDMA/CD)
  • Gigabit Ethernet
    • IEEE 802.3z standard
    • When working in full-duplex mode
      • CSMA/CD is not necessary

Ethernet Frame Header

  • Common used (Ethernet Type2 Frame):
    • MAC header
      • Destination MAC address (6 bytes)
      • Source MAC address (6 bytes)
      • Ether Type (2 bytes)
    • Data
      • Payload (46-1500 bytes)
    • FCS (Frame Check Sequence)
      • CRC checksum (4 bytes)
  • Structure
    • Preamble
    • SFD
    • Destination MAC Address
    • Source MAC Address
    • Ether Type
    • Payload
    • FCS
    • Inter-packet gap
  • Ether Type
    • 0x0800 -> IPv4
    • 0x0806 -> ARP
    • 0x8100 -> VLAN-tagged
    • 0x86DD -> IPv6
    • 0x9100 -> VLAN-tagged (double tagging)

Ethernet Frame Header

  • Maximum Transmission Unit (MTU)
    • Size of the largest Protocol Data Unit (PDU)
    • 1518 bytes by default
    • 18 bytes for layer2 header, 1500 bytes for layer2 payload
  • Jumbo Frames
    • 1500+ bytes of payload
    • Most Ethernet equipment supports to 9000+ bytes for jumbo frames
  • IEEE 802.1Q
    • Referred as dot1q
    • Support VLANs (Virtual LANs)
    • hint: Native VLAN -> id = 1
  • IEEE 802.1ad
    • Referred as Q-in-Q (double tagging)
    • Allow to use another VLAN internally for carrying traffic that is already tagged

補充資料

  • Checksum
    • Checksum is able to use a small-sized block of data to help datect the corrupted data during the transmission (or storage)
  • Cyclic Redundancy Check (CRC)
分享到