Hardware and Ethernet

Communication from interface to interface

Requires HWID of individual interfaces.

MAC Address

Media Access Control (MAC address) on each NIC (aka physical/LAN addr)

MAC address allocation is administered by IEEE.

First 3 bytes is the vender of the adapter (see https://macvendors.com).

  IP Address MAC Address
bits 32 48
move datagrams from src to dest frames over every link
assigned dynamically permanently

Address Resolution Protocol

How do we find the MAC address of a receiving host, given its IP address?

ARP Table

Contains IP addr, MAC addr, TTL.

ARP Query

A sender broadcasts a query packet, with dest MAC address FF-FF-FF-FF-FF-FF.

All other nodes will check if the IP address in the query packet matches its own.

On a match, the node will reply with a frame containing it’s MAC address.

The sender then caches the IP address and MAC address pair in its ARP table.

Sending Frame in Same Subnet

Suppose A wants to send to B (A and B are in the same subnet).

Case 1: B’s MAC address known

Case 2: B’s MAC not known

Sending Frame in Another Subnet

Q: How do you know you are sending to a different subnet?

A: If subnet doesn’t have the same IP prefix.

A should create link layer frame with

Router interface then receives and passes on to the next interface via RIP or other routing protocol.

Once the destination IP is in the same subnet as the src IP, the link-layer frame with B’s MAC address is made.

LAN technologies

LAN is any computer network interconnecting computers within a geographical area.

Some LAN technologies:

Physical topologies:

Ethernet

Ethernet standards have:

Twisted pair copper:

Optical Fibre:

Ethernet frame: NIC adapter encapsulates IP datagram

Payload : minsize 46 bytes, maxsize MT

MAin usage of the ethernet preamble: square wave pattern

Src/Dest address: MAC addresses

Delivery service features:

Bus topology

If A sends frame at time $t$, propagation time between A and D is $d$, and D sends at $t + d - 1$ => COLLISION!

Ethernet CSMA/CD:

  1. Create frame with Network layer datagram.
  2. If NIC senses the channel is idle, begin transmit.
  3. If NIC transmits entire frame without interrupt: done
  4. If another transmission is detected: abort + send jam signal to alert of collision.

Post abortion of signal: Binary/Exponential back-off

Maximum $m$ imposed: 16.

More collisions = heavier load $\Rightarrow$ Usually means longer back-off interval with more collision.

Star topology

Each end host is connected to a switch, which provides a dedicated channel per host.

Ethernet switches

A pure ethernet switch has no IP address, and is transparent/invisible to hosts.

Switch table

Records of [MAC addr, Interface (port), TTL]:

A hub does not keep a switch table, but otherwise does the same thing.

Other Userful References

https://www.practicalnetworking.net/series/packet-traveling/host-to-host-through-a-switch/