Unit 6: Application Layer and Wireless Networks

CSE306 — Computer Networks 9 min read

I. Orientation — Network Services and Wireless Communication

The application layer provides services directly to user applications, while wireless networks carry data through electromagnetic waves rather than guided cables. Application protocols depend on transport services such as TCP or UDP; wireless LAN and personal-area technologies define physical transmission, medium access, device organization, and security.

  • Layering principle: Each protocol uses lower-layer services while exposing a defined interface to the layer above.
  • Application-layer convention: Client processes usually initiate requests, while servers listen on well-known ports; peer-to-peer systems may distribute both roles.
  • Naming and addressing: Human-readable names are translated into network identifiers, as in DNS name-to-IP resolution.
  • Reliable versus lightweight transport:
    • TCP: Connection-oriented, reliable byte stream used by email and FTP.
    • UDP: Connectionless datagrams with low overhead, commonly used for ordinary DNS queries.
  • Wireless characteristics: Shared spectrum, interference, mobility, fading, and limited range affect throughput and reliability.
  • Standards bodies: The IEEE 802 family defines LAN technologies; the Bluetooth Special Interest Group maintains Bluetooth specifications.

II. Domain Name System — Distributed Name Resolution

A. Domain Name System

The Domain Name System (DNS) is a hierarchical, distributed database that maps domain names to resource information, especially IP addresses.

  • Namespace structure: Names form an inverted tree: root (.), top-level domain (com), second-level domain (example), and host (www), producing www.example.com.
  • Server hierarchy:
    • Root servers: Direct resolvers toward the appropriate top-level-domain servers.
    • TLD servers: Handle domains such as .com, .org, and country codes.
    • Authoritative servers: Store definitive records for a domain.
  • Resolution process: A stub resolver asks a recursive resolver, which follows referrals or returns a cached answer.
  • Resource records:
    • A/AAAA: Map a name to an IPv4/IPv6 address.
    • MX: Identifies a domain’s mail server.
    • NS: Identifies an authoritative name server.
    • CNAME: Defines an alias; PTR supports reverse lookup.
  • Transport: DNS normally uses UDP port 53; TCP port 53 supports large responses and zone transfers.
  • Caching: Records are retained for their time to live (TTL), reducing delay and server load but allowing temporarily stale data.
  • Security: DNSSEC provides origin authentication and integrity through digital signatures; it does not encrypt queries.

III. Email — Store-and-Forward Messaging

A. Email

Electronic mail uses cooperating user agents, mail servers, and standardized protocols to submit, transfer, store, and retrieve messages.

  • Address format: local-part@domain, as in student@example.edu; DNS MX records locate the receiving domain’s mail server.
  • SMTP operation: Simple Mail Transfer Protocol transfers outgoing mail over TCP using commands such as EHLO, MAIL FROM, RCPT TO, and DATA.
  • Ports: TCP port 25 is used for server relay, 587 for authenticated submission, and 465 for implicit TLS submission.
  • Retrieval protocols:
    1. POP3: Downloads messages, commonly using ports 110 or TLS-protected 995.
    2. IMAP: Synchronizes server-side folders and message states, using ports 143 or TLS-protected 993.
  • Message format: Headers contain fields such as From, To, Date, and Subject; a blank line separates headers from the body.
  • MIME: Multipurpose Internet Mail Extensions represent attachments, non-ASCII text, and multiple content types through headers and encodings.
  • Protection: TLS secures links between systems, while spam filtering and authentication mechanisms such as SPF, DKIM, and DMARC reduce forgery and abuse.

IV. FTP — Reliable File Transfer

A. FTP

File Transfer Protocol (FTP) transfers files over TCP while separating commands from file data.

  • Control connection: The client opens a persistent TCP connection to server port 21 for authentication and commands such as USER, RETR, and STOR.
  • Data connection: Each directory listing or file transfer uses a separate TCP connection.
  • Transfer modes:
    1. Active mode: The server initiates the data connection, traditionally from port 20, toward a client-specified port.
    2. Passive mode: The server advertises an available port and the client initiates the connection, making firewall traversal easier.
  • Representations: ASCII mode performs text-oriented conversion; binary or image mode preserves the file’s exact bytes.
  • Limitation: Basic FTP sends credentials and data without encryption. FTPS adds TLS, whereas SFTP is a different protocol operating through SSH.

V. Introduction to Wireless Networks — Communication Through Radio

A. Introduction to Wireless Networks

A wireless network connects devices through radio or infrared signals, allowing mobility and deployment without physical links.

  • Basic components: Wireless stations use antennas and transceivers; infrastructure networks communicate through an access point connected to a distribution system.
  • Operating modes:
    • Infrastructure: Stations communicate through an access point.
    • Ad hoc: Stations communicate directly without fixed infrastructure.
  • Propagation effects: Reflection, diffraction, obstacles, and multipath fading cause signal strength and error rates to vary with position.
  • Shared-medium issues: Devices may interfere even when they cannot hear one another, creating the hidden-terminal problem.
  • Performance measures: Data rate is measured in bit/s, signal strength commonly in dBm, and channel width in MHz.
  • Advantages: Mobility, rapid installation, scalability, and access in locations where cabling is impractical.
  • Limitations: Interference, finite spectrum, variable throughput, restricted range, power consumption, and exposure to unauthorized reception.

VI. IEEE 802.11 — Wireless LAN Standard

A. IEEE 802.11

IEEE 802.11 defines the physical and MAC-layer operation of wireless local-area networks commonly called Wi-Fi.

  • Architecture: A basic service set (BSS) contains stations associated with an access point; multiple BSSs connected by a distribution system form an extended service set.
  • Identification: The service set identifier (SSID) names a WLAN, while the BSSID normally identifies a particular access point radio.
  • Medium access: Distributed Coordination Function uses CSMA/CA because a radio cannot reliably detect collisions while transmitting.
  • Transmission sequence: A station senses the channel, waits an interframe interval, chooses a random backoff, transmits, and expects an acknowledgment.
  • Collision reduction: Optional RTS/CTS control frames reserve the channel and help address hidden terminals.
  • Frame classes: Management frames support discovery and association; control frames coordinate access; data frames carry higher-layer traffic.
  • Security evolution: WEP is insecure; WPA2 uses IEEE 802.11i with AES-CCMP, while WPA3 strengthens authentication and management-frame protection.

VII. 802.11a — Early 5 GHz WLAN

A. 802.11a

IEEE 802.11a, standardized in 1999, introduced high-speed OFDM operation in the 5 GHz band.

  • Data rate: Supports physical rates up to 54 Mbit/s.
  • Modulation: Orthogonal frequency-division multiplexing divides data among multiple closely spaced subcarriers.
  • Channel width: Uses approximately 20 MHz channels.
  • Trade-off: The 5 GHz band generally offers less interference and more channels than 2.4 GHz, but signals experience greater attenuation and typically shorter indoor range.
  • Compatibility: It is not radio-compatible with 2.4 GHz-only 802.11b equipment.

VIII. 802.11b — Popular 2.4 GHz WLAN

A. 802.11b

IEEE 802.11b, standardized in 1999, expanded WLAN adoption through lower-cost operation in the 2.4 GHz ISM band.

  • Data rate: Provides rates of 1, 2, 5.5, and 11 Mbit/s.
  • Technique: Higher rates use high-rate direct-sequence spread spectrum based on complementary code keying.
  • Range: Its lower frequency usually provides better obstacle penetration than 5 GHz 802.11a.
  • Interference: It shares spectrum with Bluetooth, microwave ovens, and other 2.4 GHz devices.
  • Channel overlap: Wide channels overlap substantially; deployments commonly separate neighboring access points across non-overlapping channel groups.

IX. 802.11g — Faster 2.4 GHz WLAN

A. 802.11g

IEEE 802.11g, standardized in 2003, combines 802.11a-style OFDM performance with the 2.4 GHz operating band.

  • Data rate: Supports physical rates up to 54 Mbit/s.
  • Compatibility: It is backward-compatible with 802.11b stations at supported legacy rates.
  • Modulation: OFDM carries higher rates, while legacy mechanisms permit communication with 802.11b devices.
  • Advantage: It offers greater range than typical 5 GHz systems while improving substantially on 802.11b speed.
  • Limitation: Legacy protection and slow stations consume airtime, reducing overall WLAN efficiency; 2.4 GHz interference remains significant.

X. 802.11n — MIMO and Channel Bonding

A. 802.11n

IEEE 802.11n, standardized in 2009, improves throughput and coverage through multiple antennas and more efficient transmission.

  • Frequency bands: Operates in both 2.4 GHz and 5 GHz.
  • MIMO: Multiple-input multiple-output technology sends independent spatial streams through multiple transmit and receive antennas.
  • Channel widths: Supports 20 MHz and bonded 40 MHz channels; bonding increases capacity but occupies more spectrum.
  • Maximum rate: Up to 600 Mbit/s is possible with four spatial streams, a 40 MHz channel, and a short guard interval.
  • Efficiency features: Frame aggregation combines multiple frames, reducing repeated headers, contention, and acknowledgment overhead.
  • Compatibility: It can interoperate with older 802.11 devices, although legacy clients and congested channels may reduce practical throughput.

XI. Bluetooth Architecture — Short-Range Personal Networking

A. Bluetooth Architecture

Bluetooth is a low-power, short-range wireless technology for personal-area communication in the unlicensed 2.4 GHz band.

  • Device organization: Classic Bluetooth forms a piconet in which one coordinating device communicates with as many as seven active member devices.
  • Scatternet concept: A device participating in multiple piconets can interconnect them, though implementation support varies.
  • Frequency hopping: Classic Bluetooth uses adaptive frequency-hopping spread spectrum to reduce persistent interference; unsuitable frequencies can be avoided.
  • Host-controller division:
    • Controller: Contains the radio, baseband/link controller, and lower link-management functions.
    • Host: Runs upper protocols, service discovery, profiles, and applications.
  • Bluetooth Low Energy: BLE uses 40 channels of 2 MHz, including three primary advertising channels, and organizes devices using central and peripheral roles.
  • Applications: Typical uses include headphones, keyboards, sensors, medical devices, wearables, and phone-to-device data exchange.

XII. Bluetooth Layers — Protocol Stack and Profiles

A. Bluetooth Layers

Bluetooth uses a layered protocol architecture that separates radio transmission, link control, adaptation, services, and application behavior.

  • Radio/PHY layer: Defines frequencies, modulation, transmitter power, and radio channels in the 2.4 GHz band.
  • Baseband and link controller: Manage packet timing, addressing, error control, hopping, and physical links between devices.
  • Link Manager Protocol: In Classic Bluetooth, LMP establishes and configures links, negotiates capabilities, and supports authentication and encryption.
  • Host Controller Interface: HCI standardizes commands, events, and data exchange between the host software and Bluetooth controller, commonly over USB or UART.
  • L2CAP: Logical Link Control and Adaptation Protocol multiplexes higher protocols, adapts packet sizes, and provides logical channels.
  • Service Discovery Protocol: SDP allows a Classic Bluetooth device to discover available services and their attributes.
  • RFCOMM: Emulates serial-port communication over Bluetooth and supports applications designed around serial links.
  • BLE upper layers:
    • ATT/GATT: Attribute Protocol stores data as attributes; Generic Attribute Profile organizes them into services and characteristics.
    • SMP: Security Manager Protocol handles pairing, key generation, and security procedures.
    • GAP: Generic Access Profile defines discovery, advertising, connection roles, and device visibility.
  • Profiles: Interoperability profiles specify how layers are combined for uses such as audio streaming, keyboards, file exchange, or heart-rate monitoring.