Lecture 22: OSI model

Addressing within a network

Ethernet packets are addressed to a particular device on the network. Devices are identified by Media Access Control (MAC) addresses (also called a hardware address). MAC addresses are built in to every network device. They are typically written as a sequence of six two-character hex numbers, separated by colons, for example the MAC address for the ethernet card in my laptop is f0:1f:af:2a:7d:be.

Often it is useful to have logical addresses that are not bound to a specific device, but instead to a specific function. In addition to its fixed hardware address, a host can also have have an IP address assigned to it (more on the structure and function of IP addresses in the next lecture). IP addresses are typically written as a collection of four decimal numbers between 0 and 255, separated by periods (for example, my laptop's current IP address is

To send a packet to a device having a specific IP address, a host must first find the MAC address of that device. To find this information, it uses the Address Resolution Protocol (ARP). It broadcasts an ARP request asking for the MAC address of the host with the desired IP address. The host having that IP address will respond with a packet containing its MAC address.

IP addresses can be assigned in a variety of ways. One is to configure each machine with its own IP address. This has the advantage of being completely decentralized; no central service needs to manage IP addresses. However, often you want a central service to manage IP addresses (to avoid collisions, for example, or to prevent having a network administrator from manually configuring each machine).

The Dynamic Host Configuration Protocol solves this problem: a specific host is designated as the DHCP server. When a new machine connects to the network, it broadcasts a DHCP request containing its MAC address. The DHCP server will respond to this request by sending back the host's IP address (and other configuration information).

OSI layers

Networking protocols can be broadly classified into layers, each of which depends on the layer below, and provides services to the layers above. The OSI classifications are well summarized here


Ethernet can scale to hundreds of hosts, but to scale to millions of hosts requires the ability to link different networks together. This is the job of the Network layer, which we will discuss in more detail tomorrow.