Title: 544
Tags: lec5

Q: How many bits are in a MAC address?
A: 48

Q: What does the prefix of a MAC address indicate?
A: The vendor/manufacter that produced the NIC
This is so that we can achieve globally unique MAC addresses (each vendor gets a prefix, and is expected not to reuse the same suffix for different devices).

Q: How can you see the MAC addresses and IP addresses for your NICs?
A: ip address

Q: What is a virtual NIC that is only reachable from the local machine, and what IP address does it use?
A: The "loopback" device, which has address 127.0.0.1

Q: What is a network?
A: A collection of computers that can send each other messages by MAC address

Q: Within a network, what device can forward data that is sent to a specific MAC address?
A: A switch

Q: What is the device that connects multiple networks to form an internet, or the Internet?
A: a router

Q: How many bits does an IPv4 address contain, and how many possible addresses are there?
A: 32 bits, and about 4 billion possible addresses

Q: What does the prefix of an IP address tell you?
A: It identifies the network

Q: Why do routers forward based on IP address rather than MAC address?
A: Because there are too many MAC addresses in the world, and forwarding tables would need to be too big if every router needed to remember where every MAC address lives.
With IP addresses, IPs with the same prefix are on the same network.  A router just needs to know where to forward data to get it closer to the correct network.

Q: The following are private IP ranges, meaning multiple networks can use the same IPs from these ranges internally:
192.168.0.0 to 192.168.255.255
172.16.0.0 to 172.31.255.255
10.0.0.0 to 10.255.255.255
What device/software can let us connect to machines using these IPs, given they are not unique?
A: A NAT (network address translation).
It can map a unique public address to one or more private IPs within a network.

Q: What is something that both UDP and TCP add in addition to what IP provides?
A: The both provide port numbers, which let us direct communication to a specific process on a machine

Q: What is something that TCP provides that UDP does not?
A: TCP provides more reliable communication:
retry when a packet is dropped
buffer packets on receiving side and re-arrange so they arrive in the same order they were sent

Q: What does UDP stand for?
A: User Datagram Protocol

Q: What does TCP stand for?
A: Transmission Control Protocol

Q: Why would you ever prefer UDP over TCP?
A: TCP does extra work, which is sometimes not necessary.  For example, in a Zoom call, if some packets are dropped the session may freeze.  After that, it's more natural for humans to repeat what they were saying (it would be weird if it replayed video/audio from the few seconds when the connection was lost).