4 - More on LANs

Touching a Bit on P2

It's a chat program that will use TCP, IP (and UDP) Protocol Suite. There's provided code that will do common chat functionality (so there's no copied code). It requires you to implement the protocol though, so make sure the packet format is correct! You're going to write:

LANs (defined by IEEE)

There's IEEE 802 Standards, which are Local Access Network (LAN) and Wide Area Network (WAN) standards. It specifies the first 2 layers of the protocol stack. Namely the physical and data link layer.

  • 802.3 – Ethernet
  • 802.11 – Wireless Lan
  • 802.15 – Wireless Personal Area Networks (PAN) (e.g. Bluetooth,
    Zigbee)

The data link layer specifically has a Medium Access Control (MAC) and Logical Link Control (LLC) control.

Pasted image 20250116152922.png

Really the MAC deals with the physical layer, and these layers change often over time (while things like the TCP, IP (and UDP) Protocol Suite haven't changed).

The Logical Link Control Layer has:

  • frame assembly
  • frame dissassembly
  • interface to higher levels

The Medium Access Control (MAC) has:

  • Encoding/Decoding of signals
  • Synchronization via frame preamble
  • Works with physical layer for bit Transmission/Reception

Pasted image 20250116153138.png
(an ethernet frame) (address + type + payload + FCS)

Here:

  • Wireshark would see everything starting at the destination MAC address up to the FCS (not inclusive). See program 1 for more information on that.
  • Here the FCS is a tail that is part of the error detection (CRC) for the Internet Checksum.
  • The SFD is a Start of Frame Delimiter. It tells both sides how to synchronize their clocks. This is always 1-byte is just 10101011 (notice the double 1's)
  • The Preamble is always 7-bytes and is just 1010101010...
  • Thus the stuff we are missing totlas 8-bytes = 64 bits.
Note

There's no check for if the receiver is ready. The data just will get sent immediately.

The Ethernet PDU - Protocol Data Unit is a layer 2 PDU called a frame. It is Connection-Less (Protocol), unreliable, but includes error detection.

The max payload length is normally 1500 bytes, but the jumbo size (used primarily in datacenters) is 9000 bytes (as links go faster and faster we might send more data).

Each transmit and receive wires are a twisted pair, connected like we discussed in 2 Ethernet Switches.

Pasted image 20250116154156.png

Fiber Optics

(a general fiber-optic cable)

Multimode Fiber is cheaper, has a thicker core (which makes it cheaper), but can't go as far and has lower speeds (usually in the 100's of meters)

Note

There always is an exchange of having longer distance for slower speeds, and vice versa.

Datacenters usually use Single Mode fiber which:

  • has a smaller core
  • is more expensive
  • has longer distances (50km or more)
  • can go fast

The idea of how these work is that as the light gets sent down the wire, photons move variable distances (some bounce around more). What you'll see is that the light will bleed into the next bit period:

How do we deal with this inter-symbol interference, common in multi-mode fiber? We move to single-mode fiber instead at that point. The smaller glass tube helps reduce the effect of the bouncing, but requires much more materials to make and makes it more expensive.

Different wavelengths (colors) of light represent different entry-points, so that one piece of fiber can be shared across the whole wire.

Pasted image 20250116155708.png

Wifi

Wireless Fidelity, and is Trademarked by Wi-Fi Alliance.

Any "wireless local area network (WLAN) products that are
based on the Institute of Electrical and Electronics Engineers'
(IEEE) 802.11 standards."

There have been a lot of changes to the standard over time:

Pasted image 20250116160011.png

Note

The Wifi4/5/6 name changes were done mainly for marketing alone.

As we moved to higher frequencies, the problem we saw with Fiber Optic Cable applies here: they are sent faster but the range is shorter in terms of distance.

Some common terms:

Frame

Pasted image 20250116161040.png

Here:

  • Frame body is the payload
  • FCS is again the error detection
  • Addresses for Data PDUs use:

Pasted image 20250116161315.png

This is all considered one LAN, defined by a subnet (defined later).

Authentication

Pasted image 20250116161529.png

This is defined in the IEEE Standards (Ethernet and Wireless Standards). This would be by username and password. Some common terms:

  • EAP-TLS: Extensible Authentication Protocol, Transport Layer Security
  • LDAP: Lightweight Directory Access Protocol
  • RADIUS: Remote Authentication Dial-In Service

ALOHA Protocol

Sending data to different points would cause collisions as multiple devices try to talk to one Wireless Access Point (WAP). Thus the ALOHA Protocol was made. Before they used Pure ALOHA:

  • When you have data to transmit, you listen to see if no one is transmitting
  • If no one is transmitting, you transmit
    One of the problems is that one device may start to transmit, and the other device doesn't hear this and starts transmitting. Instead, in Slotted ALOHA:
  • You divide time in discrete intervals
  • Each interval is a slot
  • Slot time is big enough to know if another device is sending
  • A sender may only transmit at the beginning of a slot
    The advantage is that you double your throughput (since there's less collisions).

Carrier Senses Multiple Access with Collision Avoidance (CSMA/CA)

When a station has data to send, you find the roundtrip time and use that as your slot time, denoted MAXRTT. You sense the channel:

  • If the channel is free for one slot time - send the frame
  • Otherwise, use Binary Exponential Backoff:
    • RTT = 2 * RTT
    • Continue again, increating RTT exponentially.
  • In 802.11 After sending, sender waits on ACK (there may have been corruption).
    • If no ACK arrives - use Binary Exponential Backoff again.
Note

This is different than Ethernet since that just will send data and hope for the best. Here for the Wifi standard the ACK check make sure that we can keep resending until we get the right data.