Tuesday, October 19, 2021

CST 311 - Week 7

Link-layer switches


This week I learned more about switches. Switches are similar to routers because they are responsible for forwarding packets. However, switches are level 2 network devices so they have no concept of an IP address (which routers use for forwarding). Instead, they use MAC addresses for forwarding. A MAC address is a unique address assigned to a device. Although MAC addresses were originally meant to be permanent, they are now able to be changed remotely. Regardless, the IEEE manages MAC address space and assigns chunks of it to organizations, similar to how IP addresses are managed and assigned. This ensures that MAC addresses are unique to devices

In order for a host to send an IP datagram, it must have not only a destination IP address but also a destination MAC address. If the destination IP address is on the same subnet as the sender, then the destination MAC address will be that of the receiving host. The switch will thus forward the datagram directly to the receiver. If the destination IP address is on another subnet, the destination MAC address will be the local router interface. In that case, the switch will forward the datagram to the router, and the router will use the IP address in the enclosed datagram to forward the datagram to the appropriate outbound link.

Address Resolution Protocol


Switches are more secure than hubs because they support point-to-point links in addition to shared broadcast channels. This means that two hosts on a network can communicate without their messages being broadcast to every other host on their subnet. To accomplish this, every host and router has an ARP table which resolves IP addresses to MAC addresses on their subnet. 

When a host first connects to a network (perhaps by plugging an ethernet cable into a switch), it obtains the MAC address of the default gateway by broadcasting an ARP request, asking who "owns" the IP address of the default gateway. The router will send an ARP reply directly back to the requesting host (not as a broadcast). Hosts may also discover each other in the same fashion. However, it is important to note that ARP tables may not contain every host on a subnet because entries can expire (using a time-to-live value), and new entries are not created until an ARP request has been sent by a host.

No comments:

Post a Comment

CST499 - Week 8

The End? I made it. This is my final week in the CS Online program here at CSUMB. I still have one final hurdle in the form of a mock techni...