Professional Documents
Culture Documents
3 MAC - Illustrations
3 MAC - Illustrations
Networks
Dr. Mohamed Saad
Department of Computer Engineering
University of Sharjah
msaad@sharjah.ac.ae
• We have seen that networks can be divided into 2 categories: those using
point-to-point links, and those using broadcast channels.
• In broadcast networks, the key issue is how to determine who gets to use
the channel when there is competition for it → multiple access
ALOHA
ALOHA
Performance (contd.)
0.20
Slotted ALOHA
• Sender algorithm:
– When a user has a frame to send, it waits until the beginning of the
next time slot and transmits the frame.
– If collision occurs, the user waits for a random number of time slots
and sends the same frame again.
• The best channel utilization that can be achieved with ALOHA is 36%.
1-persistent CSMA
• Collisions occur if 2 stations are waiting for the channel to become idle at
the same time. Once the channel becomes idle they will send together.
Nonpersistent CSMA
• This algorithm leads to better channel utilization but longer delays than
1-persistent CSMA.
p-persistent CSMA
• In CSMA protocols, if 2 stations sense the channel idle at the same time,
they may begin transmitting simultaneously.
• Consider a number of mobile devices (e.g., laptop computers) that can communicate
with each other using the radio (wireless) channel as the shared medium.
• The above configuration is known as wireless LAN. RX
TX
• Two users can communicate if they are in radio range of each other.
• Collision happens when a receiver is in radio range of 2 active transmitters. TX
A B C D A B C D
Radio range
(a) (b)
• Assume that A and B are within each other’s range and can potentially interfere with
each other. C can also interfere with B and D, but not with A.
• Let A be transmitting to B.
• If C senses the medium, it will not hear A because A is out of range, and thus will
falsely conclude that it can transmit to B → collision will occur.
• The problem of a station not being able to detect a potential competitor for the medium
because the competitor is too far away is called the hidden station problem.
A B C D A B C D
Radio range
(a) (b)
C A RTS B D C A CTS B D
E E
(a) (b)
Collision Avoidance
• Any other station hearing the RTS is clearly close to A and must remain
silent long enough for the CTS to be transmitted back to A without
conflict.
• Any station hearing the CTS is clearly close to B and must remain silent
during the upcoming data transmission (length of data transmission can
be obtained by examining the CTS frame).
• Note that any station hearing the RTS but not the CTS is close to the
sender, but far away from the receiver, and can transmit.
Example
Range of A's transmitter Range of B's transmitter
C A RTS B D C A CTS B D
E E
(a) (b)
• C is within range of A but not within range of B ⇒ C hears RTS from A but does not
hear CTS from B ⇒ C is free to transmit.
• D is within range of B but not A ⇒ D does not hear the RTS but does hear the CTS
⇒ D cannot transmit.
• E hears both RTS and CTS ⇒ E cannot transmit.
• For example, B and C could both send an RTS to A at the same time.
These will collide and be lost.
Ethernet (revisited)
Classic Ethernet
Transceiver
Interface
cable
Ether
• Transmission medium is a coaxial cable (not vacuum) called “the ether”, up to 2.5 km
long, with repeaters every 500 m.
• Up to 256 machines connected to the cable.
• Transmission rate 2.94 Mbps.
• In 1978: DEC, Intel and Xerox standardized a 10 Mbps Ethernet.
• Now 100 Mbps and 1 Gbps Ethernet’s exist.
Switched Ethernet
Data link layer Bridge, switch Frame (built by data link layer)
(a) (b)
• Repeaters: analog devices connecting two cable segments; a signal appearing on one
cable is amplified and put out on the other one. Repeaters are physical layer devices,
i.e., they do not examine any address. They do not understand frames, packets or
headers; they understand volts.
Repeater
LAN
E F G H E F G H E F G H
• Hubs:
– Each machine is connected to the hub by a separate twisted pair cable.
– Frames arriving on any of the hub’s lines are sent out (without buffering, and without
examining any address) on all other lines.
– If two frames arrive at the same time, they will collide, just as on coaxial cable. In
other words, the entire hub forms a single collision domain.
LAN
E F G H E F G H E F G H
• Switches: frames arriving at an input port/line are forwarded to the right output
port/line by reading the MAC address (in the Ethernet frame header), then looking up
a table to see where to send the frame.
• Bridges: switches used to interconnect several LANs (Ethernets), as to create extended
LANs.
• Frame formats: (a)DIX (DEC, Intel, Xerox) Ethernet. (b) IEEE 802.3.
• Preamble: 8 bytes containing the pattern 10101010 (repeated 8 times); used for
synchronization purposes (extracting the clock with the use of Manchester encoding).
• Source and destination addresses: 48-bit data link layer (MAC) addresses. Every
manufactured Ethernet board comes with a globally unique 48-bit MAC address.
• Type: tells the receiver which network layer protocol to hand the frame to.
• Data: up to 1500 bytes of data.
• Pad: frames with fewer than 64 bytes are padded out to 64 bytes. Having a minimum
frame length is important to allow senders to keep transmitting for long enough so that
they can detect a collision during transmission.
• Checksum: used for error detection.
• Switches can be used to forward packets between shared-media LANs such as Ethernets.
Such switches are sometimes known as LAN switches; historically they have been
referred to as bridges.
• If a frame arrives at one of the ports, it is forwarded along the other ports.
Learning Bridges
• A frame sent from A to B will be received by the bridge at port 1. The bridge, however,
does not need to forward this frame along port 2 (to the other LAN).
• Question: how does the bridge learn on which port the various hosts reside?
• Answer: the bridge maintains a forwarding table that specifies the port on which each
host resides. If the destination of a frame that arrives at port 1 resides also on port 1
(according to the table), the frame is not forwarded.
• To protect against the situation in which hosts may move from one
network to the other, every table entry is associated with a timeout; after
timeout the entry is deleted.
Hub
Corri dor
Switch
Hub
Thanks