ethernet
Concept
Local Area Network(LAN)
- interconnects computers within a geographical area
- ethernet - IEEE 802.3
- wi-fi - IEEE 802.11
Ethernet
- unreliable, no ACK or NAK, needs higher layer RDT to ensure reliability
- uses CSMA/CD with exponential backoff
+-----------+-----------------+------------+-----------+-----------------+-----------+
| Preamble | Destination MAC | Source MAC | Type | Datagram | CRC |
| (8 bytes) | (6 bytes) | (6 bytes) | (2 bytes) | (46-1500 bytes) | (4 bytes) |
+-----------+-----------------+------------+-----------+-----------------+-----------+
type indicates the network layer protocol being used
Preamble
- 7
AAbytes and 1ABbyte(start of frame) - synchronize receiver to the sender’s clock rate
Bus topology
- broadcast LAN
- adapters tap into the bus
- drawbacks
- all nodes can collide with each other
- slow, need to mitigate collisions
- single point of failure + hard to troubleshoot
Star topology
Hub based
- physical layer device that just rebroadcasts to other interfaces
- advantages
- cheap
- modular design, easier to maintain
- single point of failure but easily fixed
- drawbacks
- still slow
- doesn’t reduce collisions
Switch based
- works on link layer frames
- selective forwarding based on MAC address
- transparent - hosts are unaware of the presence of the switch
- plug-an-play - doesn’t need to be configured
MAC address
- media access control(MAC)
- 48 bits, burned onto every adapter/NIC
- first 3 bytes -> manufacturer
- rest -> unique ID
- broadcast MAC: FF-FF-FF-FF-FF-FF
- if NIC receives frame with matching/broadcast MAC, the frame is passed to the network layer
Selective forwarding
- record source MAC of incoming link and incoming interface
- check if destination MAC in switch table
- if entry found
- if destination MAC on incoming interface -> drop
- probably a broadcast from that segment
- else -> forward to that interface
- if destination MAC on incoming interface -> drop
- else -> broadcast to all other interfaces
Switch table
| MAC address of host | Interface to reach host | TTL |
Address Resolution Protocol(ARP)
- maps IP address to MAC address
- link layer protocol, needs to access both MAC and IP addresses
- done by network layer devices
ARP query
- send ARP query with broadcast address as dest MAC
- switch forwards to all interfaces
- target host will reply, with its MAC as the src MAC
- switch forwards to querying host
- querying host updates ARP table
ARP table
| IP Address | MAC Address | TTL |
Application
Switch table
- B sends frame to D
Frame sent to: 1, 3, 4
Host | Interface
B | 2
- D replies to B
Frame sent to: 3
Host | Interface
B | 2
D | 4
- D sends frame to A
Frame sent to: 1, 2, 3
Host | Interface
B | 2
D | 4