Purpose of The Data Link Layer
Purpose of The Data Link Layer
Contention-Based Access –
CSMA/CA
Used by IEEE 802.11 WLANs.
Operates in half-duplex mode where only one
Half and Full Duplex Communication device sends or receives at a time.
Uses a collision avoidance process to govern
Half-duplex communication (Walkie-Talkie)
when a device can send and what happens if
Only allows one device to send or receive at a
multiple devices send at the same time.
time on a shared medium.
Used on WLANs and legacy bus topologies with
CSMA/CA collision avoidance process:
Ethernet hubs.
When transmitting, devices also include the time
Full-duplex communication (Phone)
duration needed for the transmission.
Allows both devices to simultaneously transmit
Other devices on the shared medium receive the
and receive on a shared medium.
time duration information and know how long the
Ethernet switches operate in full-duplex mode.
medium will be unavailable.
Ethernet Frames
Ethernet Encapsulation
Ethernet operates in the data link layer and the
physical layer.
Field Description It is a family of networking technologies defined in
the IEEE 802.2 and 802.3 standards.
Frame Start and Stop Identifies beginning
and end of frame
Type Identifies
encapsulated Layer 3
protocol
Updated by each device that forwards the frame. use two separate sublayers of the data link layer
to operate:
- LLC Sublayer: (IEEE 802.2)
Places information in the frame to identify
which network layer protocol is used for the
frame.
- MAC Sublayer: (IEEE 802.3, 802.11, or
802.15)
Responsible for data encapsulation and
LAN and WAN Frames media access control, and provides data link
layer addressing.
The logical topology and physical media
determine the data link protocol used:
- Ethernet
- 802.11 Wireless
- Point-to-Point (PPP)
- High-Level Data Link Control (HDLC)
- Frame-Relay
Each protocol performs media access control for
specified logical topologies.
MAC Sublayer Ethernet MAC Address
MAC sublayer is responsible for data MAC Address and Hexadecimal
encapsulation and accessing the media. An Ethernet MAC address consists of a 48-bit
binary value, expressed using 12 hexadecimal
Data Encapsulation values.
IEEE 802.3 data encapsulation includes the Given that 8 bits (one byte) is a common binary
following: grouping, binary 00000000 to 11111111 can be
- Ethernet frame - This is the internal structure represented in hexadecimal as the range 00 to FF.
of the Ethernet frame. When using hexadecimal, leading zeroes are
- Ethernet Addressing - The Ethernet frame always displayed to complete the 8-bit
includes both a source and destination MAC representation. For example the binary value 0000
address to deliver the Ethernet frame from 1010 is represented in hexadecimal as 0A.
Ethernet NIC to Ethernet NIC on the same Hexadecimal numbers are often represented by
LAN. the value preceded by 0x (e.g., 0x73) to
The Ethernet frame includes a frame check distinguish between decimal and hexadecimal
sequence (FCS) trailer used for error detection. values in documentation.
Hexadecimal may also be represented by a
subscript 16, or the hex number followed by an H
Media Access
(e.g., 73H).
The IEEE 802.3 MAC sublayer includes the
specifications for different Ethernet
communications standards over various types of
Ethernet MAC Address
In an Ethernet LAN, every network device is
media including copper and fiber.
connected to the same, shared media. MAC
Legacy Ethernet using a bus topology or hubs, is
addressing provides a method for device
a shared, half-duplex medium. Ethernet over a
identification at the data link layer of the OSI
half-duplex medium uses a contention-based
model.
access method, carrier sense multiple
An Ethernet MAC address is a 48-bit address
access/collision detection (CSMA/CD).
expressed using 12 hexadecimal digits. Because
Ethernet LANs of today use switches that operate
a byte equals 8 bits, we can also say that a MAC
in full-duplex. Full-duplex communications with
address is 6 bytes in length.
Ethernet switches do not require access control
All MAC addresses must be unique to the
through CSMA/CD.
Ethernet device or Ethernet interface. To ensure
this, all vendors that sell Ethernet devices must
Ethernet Frame Fields
register with the IEEE to obtain a unique 6
The Ethernet frame size is >64 bytes and <1518 hexadecimal (i.e., 24-bit or 3-byte) code called the
bytes. The preamble field is not included when organizationally unique identifier (OUI).
describing the size of the frame. An Ethernet MAC address consists of a 6
Any frame less than 64 bytes in length is hexadecimal vendor OUI code followed by a 6
considered a “collision fragment” or “runt frame” hexadecimal vendor-assigned value.
and is automatically discarded.
Frames with more than 1500 bytes of data are
considered “jumbo” or “baby giant frames”.
Jumbo frames are usually supported by most Fast
Ethernet and Gigabit Ethernet switches and NICs.
Frame Processing
If the size of a transmitted frame is less than the When a device is forwarding a message to an
minimum, or greater than the maximum, the Ethernet network, the Ethernet header include a
receiving device drops the frame. Source MAC address and a Destination MAC
Dropped frames; result of collisions or other address.
unwanted signals. They are considered invalid. When a NIC receives an Ethernet frame, it
examines the destination MAC address to see if it
matches the physical MAC address that is stored
in RAM. If there is no match, the device discards destination IPv4 address that has all ones
the frame. If there is a match, it passes the frame (1s) in the host portion. This numbering in
up the OSI layers, where the de-encapsulation the address means that all hosts on that local
process takes place. network (broadcast domain) will receive and
Note: Ethernet NICs - accept frames if the process the packet.
destination MAC address is a broadcast or a == Figure – MAC ADDRESS sl. Unicast MAC
multicast group of which the host is a member. Address==
Any device that is the source or destination of an
Ethernet frame, will have an Ethernet NIC and a Multicast MAC Address
MAC address. This includes workstations, An Ethernet multicast frame is received and
servers, printers, mobile devices, and routers. processed by a group of devices that belong to
the same multicast group.
Unicast MAC Address There is a destination MAC address of 01-00-5E
when the encapsulated data is an IPv4 multicast
In Ethernet, different MAC addresses are used for
packet and a destination MAC address of 33-33
Layer 2 unicast, broadcast, and multicast
when the encapsulated data is an IPv6 multicast
communications.
packet.
A unicast MAC address is the unique address that
There are other reserved multicast destination
is used when a frame is sent from a single
MAC addresses for when the encapsulated data is
transmitting device to a single destination device.
not IP, such as Spanning Tree Protocol (STP).
Address Resolution Protocol (ARP) is a process
It is flooded out all Ethernet switch ports except
that a source host uses to determine the
the incoming port, unless the switch is configured
destination MAC address associated with an IPv4.
for multicast snooping. It is not forwarded by a
Neighbor Discovery (ND) is a process that a
router, unless the router is configured to route
source host uses to determine the destination
multicast packets.
MAC address associated with an IPv6 address.
Because multicast addresses represent a group of
Note: The source MAC address must always be a
addresses (sometimes called a host group), they
unicast
can only be used as the destination of a packet.
The source will always be a unicast address.
As with the unicast and broadcast addresses, the
multicast IP address requires a corresponding
multicast MAC address.
== Figure – MAC ADDRESS sl. Unicast MAC
Address==
Cut-Through Switching
In cut-through switching, the switch acts upon the
data as soon as it is received, even if the
transmission is not complete. The switch buffers
just enough of the frame to read the destination
MAC address so that it can determine to which
port it should forward out the data. The switch
destination ports.
does not perform any error checking on the frame.
There are two variants of cut-through switching: Shared memory •Deposits all frames
Fast-forward switching - Offers the lowest level of into a common
latency by immediately forwarding a packet after memory buffer shared
reading the destination address. Because by all switch ports and
fast-forward switching starts forwarding before the the amount of buffer
entire packet has been received, there may be memory required by a
times when packets are relayed with errors. The port is dynamically
destination NIC discards the faulty packet upon allocated.
receipt. Fast-forward switching is the typical •The frames in the
cut-through method of switching. buffer are dynamically
Fragment-free switching - A compromise between linked to the
the high latency and high integrity of destination port
store-and-forward switching and the low latency enabling a packet to
and reduced integrity of fast-forward switching, the be received on one
switch stores and performs an error check on the port and then
first 64 bytes of the frame before forwarding. transmitted on another
Because most network errors and collisions occur port, without moving it
during the first 64 bytes, this ensures that a to a different queue.
collision has not occurred before forwarding the
frame.
Shared memory buffering also results in larger
frames that can be transmitted with fewer dropped
Memory Buffering on Switches frames. This is important with asymmetric
switching which allows for different data rates on
An Ethernet switch may use a buffering technique
different ports. Therefore, more bandwidth can be
to store frames before forwarding them or when
dedicated to certain ports (e.g., server port).
the destination port is busy because of
congestion.
Method Description
Duplex and Speed Settings
Port-based memory •Frames are stored in
Two of the most basic settings on a switch are the
queues that are linked
bandwidth (“speed”) and duplex settings for each
to specific incoming
individual switch port. It is critical that the duplex
and outgoing ports.
and bandwidth settings match between the switch
•A frame is
port and the connected devices.
transmitted to the
outgoing port only
There are two types of duplex settings used for
when all the frames
communications on an Ethernet network:
ahead in the queue
Full-duplex - Both ends of the connection can
have been
send and receive simultaneously.
successfully
Half-duplex - Only one end of the connection can
transmitted.
send at a time.
•It is possible for a
single frame to delay
Autonegotiation is an optional function found on
the transmission of all
most Ethernet switches and NICs. It enables two
the frames in memory
devices to automatically negotiate the best speed
because of a busy
and duplex capabilities.
destination port.
•This delay occurs
Note: Gigabit Ethernet ports only operate in
even if the other
full-duplex.
frames could be
transmitted to open
Duplex mismatch is one of the most common
causes of performance issues on 10/100 Mbps
Ethernet links. It occurs when one port on the link
operates at half-duplex while the other port
operates at full-duplex.
This can occur when one or both ports on a link
are reset, and the autonegotiation process does
not result in both link partners having the same
configuration.
It also can occur when users reconfigure one side
of a link and forget to reconfigure the other. Both
sides of a link should have autonegotiation on, or
both sides should have it off. Best practice is to
configure both Ethernet switch ports as
full-duplex.
Auto-MDIX
Connections between devices once required the
use of either a crossover or straight-through cable.
The type of cable required depended on the type
of interconnecting devices.
Note: A direct connection between a router and a
host requires a cross-over connection.
Connectionless
IP is Connectionless
IP does not establish a connection with the
destination before sending the packet.
There is no control information needed
(synchronizations, acknowledgments, etc.).
The destination will receive the packet when it
The network layer will establish the Maximum
arrives, but no pre-notifications are sent by IP.
Transmission Unit (MTU).
Network layer receives this from control
Function Description
information sent by the data link layer.
The network then establishes the MTU size. Version This will be for v4,
Fragmentation is when Layer 3 splits the IPv4 as opposed to v6, a
packet into smaller units. 4 bit field= 0100
Fragmenting causes latency.
IPv6 does not fragment packets. Differentiated Used for QoS:
Example: Router goes from Ethernet to a slow Services DiffServ – DS field
WAN with a smaller MTU or the older IntServ
– ToS or Type of
IPv4 Packet Service
IPv6 Overview
IPv6 was developed by Internet Engineering Task
Significant fields in the IPv4 header
Force (IETF).
as opposed to v4, a
IPv6 overcomes the limitations of IPv4.
4 bit field= 0110
Improvements that IPv6 provides:
Increased address space – based on 128 bit Traffic Class Used for QoS:
address, not 32 bits Equivalent to
Improved packet handling – simplified header with
DiffServ – DS field
fewer fields
Eliminates the need for NAT – since there is a Flow Label Informs device to
huge amount of addressing, there is no need to handle identical flow
use private addressing internally and be mapped labels the same
to a shared public address
way, 20 bit field
Default Gateway
A router or layer 3 switch can be a
default-gateway.
Features of a default gateway (DGW):
It must have an IP address in the same range as
the rest of the LAN.
It can accept data from the LAN and is capable of
Introduction to Routing
forwarding traffic off of the LAN.
It can route to other networks.
Router Packet Forwarding Decision
If a device has no default gateway or a bad default What happens when the router receives the frame
gateway, its traffic will not be able to leave the from the host device?
LAN.
Must be adjusted manually by the administrator This command shows types of routes:
principle network layer communication protocols. It cannot manage or fix undelivered or corrupt
IPv6 Overview
IPv6 was developed by Internet Engineering Task
Force (IETF).
IPv6 overcomes the limitations of IPv4.
Improvements that IPv6 provides:
Increased address space – based on 128 bit
Significant fields in the IPv4 header:
address, not 32 bits
Improved packet handling – simplified header with
Function Description
fewer fields
Version This will be for v4, as Eliminates the need for NAT – since there is a
IPv6 Packets
IPv6 Packet Header
Limitations of IPv4
Significant fields in the IPv4 header:
IPv4 has three major limitations:
IPv4 address depletion – We have basically run
The Source device determines whether the
Function Description
destination is local or remote
Version This will be for v6, as Method of determination:
opposed to v4, a 4 bit IPv4 – Source uses its own IP address and
field= 0110 Subnet mask, along with the destination IP
address
Traffic Class Used for QoS:
IPv6 – Source uses the network address and
Equivalent to DiffServ
prefix advertised by the local router
– DS field
Local traffic is dumped out the host interface to be
Flow Label Informs device to handled by an intermediary device.
handle identical flow Remote traffic is forwarded directly to the default
labels the same way, gateway on the LAN.
20 bit field
Default Gateway
Payload Length This 16-bit field
indicates the length of A router or layer 3 switch can be a
the data portion or default-gateway.
payload of the IPv6 Features of a default gateway (DGW):
packet It must have an IP address in the same range as
the rest of the LAN.
Next Header I.D.s next level
It can accept data from the LAN and is capable of
protocol: ICMP, TCP,
forwarding traffic off of the LAN.
UDP, etc.
It can route to other networks.
Hop Limit Replaces TTL field If a device has no default gateway or a bad default
Layer 3 hop count gateway, its traffic will not be able to leave the
LAN.
Source IPv4 Address 128 bit source
address A Host Routes to the Default
Destination IPV4 128 bit destination Gateway
Address address
The host will know the default gateway (DGW)
IPv6 packet may also contain extension headers either statically or through DHCP in IPv4.
(EH). IPv6 sends the DGW through a router solicitation
EH headers characteristics: (RS) or can be configured manually.
provide optional network layer information A DGW is static route which will be a last resort
are optional route in the routing table.
are placed between IPv6 header and the payload All device on the LAN will need the DGW of the
may be used for fragmentation, security, mobility router if they intend to send traffic remotely.
support, etc.
Static Routing
Static Route Characteristics:
Must be configured manually
Must be adjusted manually by the administrator
when there is a change in the topology
Good for small non-redundant networks
Often used in conjunction with a dynamic routing
protocol for configuring a default route
Dynamic Routing
Dynamic Routes Automatically:
Module 9: Address ARP
There are two primary addresses assigned to a Resolving IPv4 addresses to MAC addresses
Copper Cabling
Commands Description
Configure Interfaces
show ip interface Displays all interfaces,