Layer 5 of the OSI model is the “session layer”,
sandwiched between layer 4 (tranport) and 6 (presentation).
What is the purpose of the session layer?
It provides the illusion of a virtual connection (“session”)
between computers; lower layers are focused on simply sending a
one-time message from one computer to another, without any
chance to respond.
Layer 3 of the OSI model is the “network layer”,
sandwiched between layer 2 (data link) and 4 (transport).
What is the purpose of the network layer?
The network layer specifies how to route between two hosts
that are not physically connected. This includes how hosts are
identified — i.e., their addresses.
Modern Ethernet networks typically use two different kinds of
cabling. Name each, and identify an advantage of each.
Twisted-pair cables (made of copper, like telephone wires)
and fiber optic cables. Twisted-pair cabling is cheaper and
easier to work with; fiber optic cables can transport a
signal much farther (e.g., for 10Mbit Ethernet, twisted-pair's
maximum length is 100m while fiber's maximum is 2000m),
is harder to tap, and the signal is not affected by
Suppose two Ethernet hosts begin to send information on the network at
virtually the same time, but midway through sending information
each realizes that somebody else is sending information on the
same wire. What happens?
First, they send a jamming signal, signaling to everybody
on the network that a collision has occurred and the current
frame on the network should be ignored.
Then, each host chooses randomly whether to wait 0 or 1
“slots” (a time representing the longest possible
round-trip time) before resending its frame.
If there is still a collision, it chooses to wait a random
number of slots chosen between 0 and 3 before re-sending.
If the collision persists, it waits between 0 and 7 slots before
After 16 attempts with doubling the maximum wait time with each
attempt, it simply gives up on sending that frame.
(Actually, on reaching 10 attempts, it no longer doubles the maximum
If too little data is packaged in an Ethernet frame, the Ethernet
standard requires that the payload be padded to meet
its minimum length of 46 bytes.
Why does it have this minimum length with wasted padding?
Suppose two computers on the opposite end of a large network
simultaneously send frames. If both frames are very short, then
each device could manage to send all of its frame out before it
senses that somebody else is simultaneously sending a signal.
Consequently, the devices would conclude that the frame was sent
successfully, even though there was in fact a collision that
neither could detect.
If a Ethernet controller is marked as the recipient of a frame,
but the checksum included in the frame does
not match what it computes the checksum should be,
what does the controller do?
It simply ignores the frame. That is, it does not attempt
to send a message to the sender, nor does it give the enclosed
data to the operating system to process.
How does an Ethernet hub work differently from an Ethernet switch?
In a hub, all ports are wired together, so that a signal
received from any port is echoed out to all other ports.
By contrast, on receiving a frame through one port, a switch
forwards the frame only to the recipient's port (if the
recipient's location is known — otherwise it is broadcast
to all ports).
How can an Ethernet switch “learn” the correspondence of
recipients to ports?
Whenever the switch receives an Ethernet frame through a port,
the frame contains the MAC address of the device sending the frame.
The switch inserts this MAC address/port mapping into its table.
What is a MAC address, and how is it typically determined?
A MAC address is a 6-byte address associated with an Ethernet
node, used for addressing messages to that node.
It is typically determined uniquely by the device manufacturer:
Each device manufacturer reserves the first three bytes with a
central authority, and the manufacturer uses that and a final three bytes
of its choosing to hard-wire into each device.