Try โ€‚โ€‰HackMD

Wireless, Mobility, and Putting it all Together

Topics Covered: Wireless, Mobility, Indirect Routing, Brief Cumulative Review

Wireless

Wireless is not the same thing as mobility, but are related. Wireless just refers to being able to connect hosts over a wireless link. Mobility is connecting hosts where the network that one "belongs to" changes over time. Imagine you have a smart phone, you're on a Whatsapp call over data, then connect to WiFi halfway through. How do we handle that?

Terminology

AP (Access Point): Also called a base station, provides wireless connectivity to a local area. In fact, wireless routers in homes are common, providing both wireless connectivity and routing in one unit. The administrator chooses a frequency for that AP, and broadcasts a beacon frame periodically with its MAC address. Devices which want to connect to a certain AP listen for this beacon frame, and then run DHCP to get IP address in the AP's subnet (note: AP is not a subnet).

BSS (Basic Service Set): An AP and its wireless hosts.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

Passive vs Active Scanning

In passive scanning, the beacon frames are sent from APs, and the association request frame (request to join a certain AP) is sent from the host, and response from the AP.
In active scanning, the host broadcasts a probe request frame, AP sends probe response frame. The host then sends an association request frame and AP responds as with passive scanning.

Key difference between the two is that passive scanning involves the APs bearing responsibility for informing possible hosts of their availability, while active scanning involves the new host asking for what is available.

CSMA/CA

In wireless, we can't really detect collisions, due to the nature of wireless mediums. It's hard to measure radio frequency signals since they fade quickly (not gonna go into the EE stuff here but trust me). So instead of CSMA/CD we introduce CSMA/CA (collision avoidance).

  1. We do the usual channel sensing. If it's idle for some DIFS period of time, then transmit the entire frame (no aborting or jamming).
  2. If it is busy, then start a random backoff timer
    2.1. If still busy after timer expires, repeat step 2.
    2.2. If idle, then transmit whole frame, wait for ACK, retry if no ACK received within timer duration.
  3. If the receiver gets the whole frame, send ACK after SIFS period of time.
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More โ†’

Mobility

Mobility involves selecting the right AP and maintaining a reachable IP address. If we are staying within the same subnet, then our IP address doesn't need to change, which simplifies things. If we detect that our current AP is too weak (we are too far from it), then find a new AP, and since we are connected to the same switch, that switch can relearn which interface is connected to our host. Not too difficult. But what if our movement means our IP address needs to change?

Let's first define a home to be the place where the host is based from. For a stationary host, like a desktop computer, it's always home. For a mobile host, like a smartphone, it might not be at home (going to work, school, etc). If we aren't at home, we need to get a new IP address. We assign a home agent to keep track of where the mobile host is.

We define a few more terms.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

So the steps are fairly simple. When the mobile host joins a new network (visited network):

  1. It gets assigned an IP
  2. Mobile contacts home agent on home network, tells it the new address
  3. Now the home agent knows the mobile host's new IP

Indirect Routing

Let's say you were on a video call on your iPhone with someone, and you started on your home network, then during the call walked over to Starbucks across the street. Starbucks has its own WiFi and network, which you connected to because your home connection was too weak. Starbucks gives you a new IP (DHCP), and you inform your home agent of your new IP. The person you're calling only knows about your old IP though, so how does the call continue?

  1. Call participant host addresses packets to your permanent address.
  2. Home network intercepts (receives) those packets, then uses IP tunneling (remember that?) to redirect to your new network's gateway router (Starbucks)โ€ฆ
  3. which then forwards to your mobile device.
  4. Since you know of the other participant's IP, you continue to address packets as normal.

Sometimes this is called triangle routing.

Brief Cumulative Review

Let's go over what happens if we have a new device/host and we want to connect to the Internet and access google.com, incorporating as much of what we learned along the way as possible.

Connecting to the Internet

I'll go off the example in lecture for this.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More โ†’

I like to think of this process as obtaining prerequisites.

  1. In the beginning, we have no IP. We have no knowledge about our local network, and how we can access the greater Internet.
  2. What protocol gets us our IP? DHCP. Our DHCP request is a UDP datagram, which is the payload of an IP packet, which is the payload of an Ethernet frame. We broadcast this on our LAN, and it's received by a DHCP server.
    • That DHCP server gives us: our IP address, the address of our first-hop router (how to access the rest of the Internet), the address of the DNS server (belongs to an ISP like Comcast).
    • In the process, the switch has learned our MAC address and what interface is associated with our host. How?
  3. Now we know our IP, we need to figure out how to access Google. We need their IP address, so we use DNS. Again we create a UDP datagram, and we know we need to get to the DNS server's IP, but there's one issue. We know our first-hop router's IP but not its MAC.
  4. So we need ARP. We broadcast an ARP query, which the router replies to with its MAC address. Then we can transmit the frame (which contains the IP packet which contains the UDP DNS query).
  5. Thanks to BGP and OSPF, our first-hop router knows how to reach the DNS server, and that DNS server knows how to reach our first-hop router with the IP address of google.com.
  6. We can then open a TCP connection using the same BSD socket API you used in project one, and after the handshake we can transmit our HTTP request over TCP, which google.com will respond to with the HTML and Javascript and images necessary to display the webpage in front of you.

Quick Takeaways

These summarized lecture notes, along with the activities and content covered in discussion, should be enough to have a solid theoretical (and a bit applied thanks to the projects) understanding of networking. In my opinion, this is one of the most undervalued courses within the UCLA CS department and is a must-do for any good software engineer. Assuming we keep offering CS 134, distributed systems is a good next step, and there are a LOT of jobs (yes, even in this job market) in backend and big data engineering systems. Best of luck with your future endeavors!

โ€“ Spring 2024 LAs

Next Week's Topics: Crushing the Final Exam and Having a Good Break